Weekend research.
> The level of support for transactions, specifically the JTA extensions to
> JDBC 2.0, is important to know.
The driver is JDBC 1.2 type 4 compliant written in JDK 1.1.7.
> What you might want to do (because I don't have time) is to check out the
> latest CVS code, in which Minerva has been replaced with JBossPool, which is
> functionally identical to Minerva but has its source code included in CVS,
> and add some tracing code into org.jboss.pool.jdbc.xa.wrapper.XAResourceImpl
> in the commit method.
>
I have had a go at this but the results mean little to me. Here is the debug code
I put in
public void commit(Xid id, boolean twoPhase) throws XAException {
System.out.println("id : " + id.toString());
System.out.println("twoPhase : " + twoPhase);
System.out.println("active : " + active);
System.out.println("current : " + current);
try{
System.out.println("Con transaction isolation level : " + con.getTransactionIsolation());
System.out.println("Con is closed : " + con.isClosed());
System.out.println("Con is read only : " + con.isReadOnly());
System.out.println("Con is auto commit : " + con.getAutoCommit());
} catch (SQLException sqle){}
if(active && !twoPhase) // End was not called!
System.err.println("WARNING: Connection not closed before transaction commit.\nConnection will not participate in any future transactions.\nAre you sure you want to be doing this?");
if(current == null || !id.equals(current)) { // wrong Xid
System.out.println("current == null || !id.equals(current)");
throw new XAException(XAException.XAER_NOTA);
}
try {
if(con.getAutoCommit()){
System.out.println("Throw XA_HEURCOM exception");
throw new XAException(XAException.XA_HEURCOM);
}
} catch(SQLException e) {
System.out.println("[SQL Exception] from getAutoCommit : " + e.getMessage());
}
try {
con.commit();
System.out.println("commit");
} catch(SQLException e) {
System.out.println("[SQL Exception] from commit : " + e.getMessage());
try {
con.rollback();
if(!twoPhase)
throw new XAException(XAException.XA_RBROLLBACK);
} catch(SQLException e2) {
System.out.println("[SQL Exception] from rollback : " + e.getMessage());
}
if(twoPhase)
throw new XAException(XAException.XA_HEURRB); // no 2PC!
else
throw new XAException(XAException.XA_RBOTHER);
// Truly, neither committed nor rolled back. Ouch!
}
current = null;
if(active){
active = false; // No longer associated with the original transaction
System.out.println("No longer associated with the original transaction");
} else {
xaCon.transactionFinished(); // No longer in use at all
System.out.println("No longer in use at all");
}
}
And here are my results.
id : XidImpl [FormatId=257, GlobalId=justin//0, BranchQual=1]
twoPhase : true
active : false
current : XidImpl [FormatId=257, GlobalId=justin//0, BranchQual=1]
Con transaction isolation level : 1
Con is closed : false
Con is read only : false
Con is auto commit : true
Throw XA_HEURCOM exception
java.net.SocketException: Descriptor not a socket: socket write error
java.net.SocketOutputStream.socketWrite(Native Method)
java.net.SocketOutputStream.write(SocketOutputStream.java:83)
jdbc.transoft.TsInet.MsgSend(TsInet.java:271)
jdbc.transoft.TsInet.MsgTx(TsInet.java:253)
jdbc.transoft.TsInet.Tx(TsInet.java:149)
jdbc.transoft.Statement.close(Statement.java:133)
org.opentools.minerva.jdbc.PreparedStatementFactory.deleteObject(PreparedStatementFactory.java:39)
org.opentools.minerva.cache.LeastRecentlyUsedCache.removeNode(LeastRecentlyUsedCache.java:243)
org.opentools.minerva.cache.LeastRecentlyUsedCache.close(LeastRecentlyUsedCache.java:94)
org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl.close(XAConnectionImpl.java:108)
org.opentools.minerva.jdbc.xa.XAConnectionFactory.deleteObject(XAConnectionFactory.java:298)
org.opentools.minerva.pool.ObjectPool.releaseObject(ObjectPool.java:665)
org.opentools.minerva.jdbc.xa.XAConnectionFactory$3.transactionFailed(XAConnectionFactory.java:153)
org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl.transactionFailed(XAConnectionImpl.java:150)
org.opentools.minerva.jdbc.xa.wrapper.XAResourceImpl.forget(XAResourceImpl.java:142)
org.jboss.tm.TxCapsule.gotHeuristic(TxCapsule.java:1310)
org.jboss.tm.TxCapsule.commitResources(TxCapsule.java:1517)
org.jboss.tm.TxCapsule.commit(TxCapsule.java:341)
org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:76)
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:318)
org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:164)
org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106)
org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:316)
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:369)
java.lang.reflect.Method.invoke(Native Method)
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
sun.rmi.transport.Transport$1.run(Transport.java:142)
java.security.AccessController.doPrivileged(Native Method)
sun.rmi.transport.Transport.serviceCall(Transport.java:139)
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:643)
java.lang.Thread.run(Thread.java:484)
Does this suggest any problem? As far as I can tell this method seems to be doing what it was designed to do.
Is there somwhere else that I should be looking?
Justin Harrison McCarthy & Associates Ltd [EMAIL PROTECTED] +64 6 834 3360 Floor 5 McLean Towers Shakespeare Rd Napier New Zealand _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
