Atomikos Forum |
|
Hi all,
I am exepriencing a weird situation in my application. I am using atomikos 3.3.1, spring 2.5.5, ibatis 2.3.3.720, Oracle RAC configuration DTP enabled. Under some circumstance I have that some operation are committed, others are not. According to the input I expected a roolback for all the operations. In the log file I have the message: getCompositeTransaction() returning NULL! Using the same input for my application I have that all the operation are correctly rolledback. Having a look at the log files I have the following messages: getCompositeTransaction() returning instance with id SRICDIFF0342900009 XAResource.rollback ( SRICDIFF0342900009SRICDIFF10 229 ) called on resource XADIFF_DAO_DIFFERITE represented by XAResource instance oracle.jdbc.driver.T4CXAResource@15e2a4d XAResource.rollback ( SRICDIFF0342900009SRICDIFF10 228 ) called on resource XACART_DAO_DIFFERITE represented by XAResource instance oracle.jdbc.driver.T4CXAResource@1ea25aa XAResource.rollback ( SRICDIFF0342900009SRICDIFF10 230 ) called on resource XARETEAFF represented by XAResource instance oracle.jdbc.driver.T4CXAResource@1aea727 rollback() done of transaction SRICDIFF0342900009
Hi,
Probably you are seeing this issue: default82df.html?community.6.413.2 Please try with the latest 3.5.2 as this has been fixed in there. HTH
Hi,
I upgraded to Atomikos 3.5.2. I don't exeperience the some weird behaviour. I had to modify the test case to make it work on oracle so I post for future use. import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; import javax.sql.DataSource; import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; import javax.transaction.NotSupportedException; import javax.transaction.RollbackException; import javax.transaction.SystemException; import javax.transaction.TransactionManager; import com.atomikos.icatch.jta.UserTransactionManager; import com.atomikos.jdbc.AtomikosDataSourceBean; public class TestAtomikos { // Atomikos implementations private static UserTransactionManager utm; private static AtomikosDataSourceBean sdsb; // Standard interfaces private static TransactionManager tm; private static DataSource ds; // initialize resources private static void init() throws SystemException { UserTransactionManager utm = new UserTransactionManager(); utm.init(); tm = utm; sdsb = new AtomikosDataSourceBean(); sdsb.setUniqueResourceName("TESTXA"); sdsb.setXaDataSourceClassName("oracle.jdbc.xa.client.OracleXADataSource"); sdsb.setPoolSize(5); Properties xaProperties = new Properties(); xaProperties.setProperty("URL", "jdbc:oracle:thin:@host:port:sid"); xaProperties.setProperty("user", "userName"); xaProperties.setProperty("password", "pwd"); sdsb.setXaProperties(xaProperties); ds = sdsb; } // release resources private static void shutdown() throws SQLException { sdsb.close(); utm.close(); utm.close(); } public static void main(String[] args) throws SQLException, NotSupportedException, SystemException, SecurityException, IllegalStateException, RollbackException, HeuristicMixedException, HeuristicRollbackException, InterruptedException { init(); tm.begin(); Connection c = ds.getConnection(); // The first statement Statement statement1 = c.createStatement(); statement1.execute("insert into table values('xxx',...)"); statement1.close(); // The default timeout will be 10 seconds, so during this wait the first statement will roll back Thread.sleep(15000); // The second statement, this will apparently be performed outside a transactional context !?!? Statement statement2 = c.createStatement(); statement2.execute("insert into table values('yyy',...)"); statement2.close(); c.close(); // IllegalStateException will be thrown tm.commit(); shutdown(); } }
Hi all,
I am still having the some weid problem. Reading from the log file it seams that all aperation are committed. But if I have a look at the database using some select query I can't find the updated values. Here is some log line: addParticipant ( XAResourceTransaction: 535249434449464630303037313030303034:5352494344494646313430 ) for transaction XATRANSACTION0007100004 XAResource.start ( 535249434449464630303037313030303034:5352494344494646313430 , XAResource.TMNOFLAGS ) called on resource RESOURCE1 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@66dd81be atomikos connection proxy for oracle.jdbc.driver.LogicalConnection@51e2d0af: calling prepareCall... atomikos connection proxy for oracle.jdbc.driver.LogicalConnection@51e2d0af: calling prepareCall... atomikos connection proxy for oracle.jdbc.driver.LogicalConnection@71f3b908: close()... XAResource.end ( 535249434449464630303037313030303034:5352494344494646313338 , XAResource.TMSUCCESS ) called on resource RESOURCE2 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@37f8f6aa atomikos connection proxy for oracle.jdbc.driver.LogicalConnection@1a8d438b: close()... XAResource.end ( 535249434449464630303037313030303034:5352494344494646313339 , XAResource.TMSUCCESS ) called on resource RESOURCE3 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@304d684b atomikos connection proxy for oracle.jdbc.driver.LogicalConnection@51e2d0af: close()... XAResource.end ( 535249434449464630303037313030303034:5352494344494646313430 , XAResource.TMSUCCESS ) called on resource RESOURCE1 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@66dd81be commit() done (by application) of transaction XATRANSACTION0007100004 XAResource.prepare ( 535249434449464630303037313030303034:5352494344494646313338 ) returning XAResource.XA_RDONLY on resource RESOURCE2 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@37f8f6aa XAResource.prepare ( 535249434449464630303037323030303034:5352494344494646313431 ) returning XAResource.XA_RDONLY on resource RESOURCE2 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@37f8f6aa XAResource.prepare ( 535249434449464630303037333030303034:5352494344494646313435 ) returning OK on resource RESOURCE3 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@304d684b XAResource.commit ( 535249434449464630303037333030303034:5352494344494646313435 , false ) called on resource RESOURCE3 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@304d684b XAResource.prepare ( 535249434449464630303037353030303034:5352494344494646313439 ) returning OK on resource RESOURCE2 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@3d165dcf XAResource.commit ( 535249434449464630303037353030303034:5352494344494646313439 , false ) called on resource RESOURCE2 represented by XAResource instance oracle.jdbc.driver.T4CXAResource@3d165dcf any help will be appreciated |