Last active
December 18, 2015 09:59
-
-
Save ricston-git/5765160 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ricston.jdbc.xapool; | |
import java.sql.SQLException; | |
import java.sql.SQLFeatureNotSupportedException; | |
import java.util.logging.Logger; | |
import javax.sql.XAConnection; | |
import javax.sql.XADataSource; | |
import org.enhydra.jdbc.pool.StandardXAPoolDataSource; | |
import org.enhydra.jdbc.standard.StandardXAConnectionHandle; | |
public class RicstonStandardXAPoolDataSource extends StandardXAPoolDataSource implements XADataSource { | |
/** | |
* | |
*/ | |
private static final long serialVersionUID = -6060990263159819182L; | |
@Override | |
public XAConnection getXAConnection() throws SQLException { | |
return ((StandardXAConnectionHandle) this.getConnection()).xacon; | |
} | |
@Override | |
public XAConnection getXAConnection(String user, String password) | |
throws SQLException { | |
return ((StandardXAConnectionHandle) this.getConnection(user, password)).xacon; | |
} | |
public Logger getParentLogger() throws SQLFeatureNotSupportedException{ | |
throw new SQLFeatureNotSupportedException(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Root Exception stack trace: | |
org.h2.jdbc.JdbcSQLException: The object is already closed [90007-172] | |
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) | |
at org.h2.message.DbException.get(DbException.java:169) | |
at org.h2.message.DbException.get(DbException.java:146) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<spring:bean id="internalDataSource" class="org.h2.jdbcx.JdbcDataSource" > | |
<spring:property name="URL" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" /> | |
<spring:property name="user" value="" /> | |
<spring:property name="password" value="" /> | |
</spring:bean> | |
<spring:bean id="pooledDataSource" class="org.apache.tomcat.jdbc.pool.XADataSource" > | |
<spring:property name="dataSource" ref="internalDataSource" /> | |
</spring:bean> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.sql.SQLException: Connection is closed | |
at org.enhydra.jdbc.standard.StandardConnectionHandle.preInvoke(StandardConnectionHandle.java:117) | |
at org.enhydra.jdbc.core.CoreConnection.getAutoCommit(CoreConnection.java:104) | |
at org.mule.transport.jdbc.xa.ConnectionWrapper.getAutoCommit(ConnectionWrapper.java:113) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<spring:bean id="internalDataSource" class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> | |
<spring:property name="driverName" value="org.h2.Driver" /> | |
<spring:property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" /> | |
<spring:property name="user" value="" /> | |
<spring:property name="password" value="" /> | |
</spring:bean> | |
<spring:bean id="pooledDataSource" class="org.apache.tomcat.jdbc.pool.XADataSource" > | |
<spring:property name="dataSource" ref="internalDataSource" /> | |
</spring:bean> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.mule.api.transaction.TransactionException: Endpoint is transactional but transaction does not support it | |
at org.mule.transport.AbstractConnector.getTransactionalResource(AbstractConnector.java:2015) | |
at org.mule.transport.jdbc.JdbcMessageDispatcher.doSend(JdbcMessageDispatcher.java:71) | |
at org.mule.transport.AbstractMessageDispatcher.process(AbstractMessageDispatcher.java:81) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<spring:bean id="internalDataSource" class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> | |
<spring:property name="driverName" value="org.h2.Driver" /> | |
<spring:property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" /> | |
<spring:property name="user" value="" /> | |
<spring:property name="password" value="" /> | |
</spring:bean> | |
<spring:bean id="pooledDataSource" class="org.enhydra.jdbc.pool.StandardXAPoolDataSource" destroy-method="shutdown"> | |
<spring:property name="user" value="" /> | |
<spring:property name="password" value="" /> | |
<spring:property name="dataSource" ref="internalDataSource" /> | |
</spring:bean> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<spring:bean id="internalDataSource" class="org.enhydra.jdbc.standard.StandardXADataSource" destroy-method="shutdown"> | |
<spring:property name="driverName" value="org.h2.Driver" /> | |
<spring:property name="url" value="jdbc:h2:mem:test;DB_CLOSE_DELAY=-1" /> | |
<spring:property name="user" value="" /> | |
<spring:property name="password" value="" /> | |
</spring:bean> | |
<spring:bean id="pooledDataSource" class="com.ricston.jdbc.xapool.RicstonStandardXAPoolDataSource" destroy-method="shutdown"> | |
<spring:property name="user" value="" /> | |
<spring:property name="password" value="" /> | |
<spring:property name="dataSource" ref="internalDataSource" /> | |
</spring:bean> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment