BTM 1.2 Spring Configuration

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

BTM 1.2 Spring Configuration

Amin Abbaspour
Hi All,

Seems BTM 1.2 does not work with the same Spring configurations as it was for 1.1/1.0. Has anyone used version 1.2 along with Spring? I may put some time to fix this myself but just wanted to know if a shorter path exists?

Regards,
Amin
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BTM 1.2 Spring Configuration

Ludovic Orban
Administrator
Amin,

Nothing have changed in this regard as far as I can say. What is the exact problem you're facing ?

Thanks,
Ludovic
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BTM 1.2 Spring Configuration

Amin Abbaspour
Dear Ludovic,

I receive this exception within BTM 1.2 while it is ok in 1.1; As shown the cause is Oracle driver (XAER_RMERR) and not Spring. Sorry that I did not review it carefully before asking the questions.

What can I do to fix this?

Amin

Caused by: bitronix.tm.recovery.RecoveryException: error running recovery on resource jdbc/DataSource (XAER_RMERR)
        at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:168)
        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:106)
        at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:47)
        ... 28 more
Caused by: javax.transaction.xa.XAException
        at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:715)
        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:231)
        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:194)
        at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:164)
Ludovic Orban wrote
Amin,

Nothing have changed in this regard as far as I can say. What is the exact problem you're facing ?

Thanks,
Ludovic
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BTM 1.2 Spring Configuration

Ludovic Orban
Administrator
Amin,

Could it be that your Oracle user has not been granted privileges for XA?

see: http://docs.codehaus.org/display/BTM/JdbcXaSupportEvaluation#JdbcXaSupportEvaluation-Oracle

You basically have to have a DBA execute these SQL commands:

grant select on sys.dba_pending_transactions to myUser;
grant select on sys.pending_trans$ to myUser;
grant select on sys.dba_2pc_pending to myUser;
grant execute on sys.dbms_system to myUser;

There was a bug in version 1.1 (http://jira.codehaus.org/browse/BTM-2) that prevented BTM to report this error.

Ludovic
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BTM 1.2 Spring Configuration

urckle
Hi There,
just a quick question on BTM and Oracle. I have switched my DB vendor to Oracle and have had to grant the permissions mentioned above to the user etc. So all of this works now. However when I run my app I don't see any DEBUG statements for the tx such as START, PREPARE, COMMIT etc. Does this mean that the TM is not working in XA mode? I ws seeing this output running my app against MySql. This is the only thing I've changed (the DataSource settings now point to Oracle.)

thanks
Andre




Ludovic Orban wrote
Amin,

Could it be that your Oracle user has not been granted privileges for XA?

see: http://docs.codehaus.org/display/BTM/JdbcXaSupportEvaluation#JdbcXaSupportEvaluation-Oracle

You basically have to have a DBA execute these SQL commands:

grant select on sys.dba_pending_transactions to myUser;
grant select on sys.pending_trans$ to myUser;
grant select on sys.dba_2pc_pending to myUser;
grant execute on sys.dbms_system to myUser;

There was a bug in version 1.1 (http://jira.codehaus.org/browse/BTM-2) that prevented BTM to report this error.

Ludovic
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BTM 1.2 Spring Configuration

Ludovic Orban
Administrator
Are you speaking about JDBC driver logs ? Or are you monitoring executed SQL statements ?

I know MySQL is using some sql statements like XA START/END/PREPARE/COMMIT like you describe. Oracle on the other hand uses some stored procedures calls but that depends on the exact driver and database versions.

If you configured the Oracle XADataSource, the TM will use XA and nothing else. You can also monitor the 2PC execution by configuring DEBUG logs on bitronix.tm.twopc category.

Ludovic
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BTM 1.2 Spring Configuration

urckle
Hi Ludovic,
yes I was beginning to wonder if these were not being logged from the MySql Driver. I was seeing them on the server console. But they disappeared once I switched to Oracle. I temporarily plugged in a different TM and the same occurred so must be the Driver itself.

Thanks again for your prompt response and the log config!

Andre


 
Ludovic Orban wrote
Are you speaking about JDBC driver logs ? Or are you monitoring executed SQL statements ?

I know MySQL is using some sql statements like XA START/END/PREPARE/COMMIT like you describe. Oracle on the other hand uses some stored procedures calls but that depends on the exact driver and database versions.

If you configured the Oracle XADataSource, the TM will use XA and nothing else. You can also monitor the 2PC execution by configuring DEBUG logs on bitronix.tm.twopc category.

Ludovic
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BTM 1.2 Spring Configuration

Amin Abbaspour
In reply to this post by Ludovic Orban
Hi Ludovic,

Thanks. It's fixed.

Amin

Ludovic Orban wrote
Amin,

Could it be that your Oracle user has not been granted privileges for XA?

see: http://docs.codehaus.org/display/BTM/JdbcXaSupportEvaluation#JdbcXaSupportEvaluation-Oracle

You basically have to have a DBA execute these SQL commands:

grant select on sys.dba_pending_transactions to myUser;
grant select on sys.pending_trans$ to myUser;
grant select on sys.dba_2pc_pending to myUser;
grant execute on sys.dbms_system to myUser;

There was a bug in version 1.1 (http://jira.codehaus.org/browse/BTM-2) that prevented BTM to report this error.

Ludovic
Loading...