Transactions don't rollback with Websphere MQ

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

Transactions don't rollback with Websphere MQ

khaliloo
Hello,

I'm facing a weird problem using Bitronix Transaction Manager with Websphere MQ and an Oracle database.
My Spring application unstacks MQ messages and inject them in a database table with a XA transaction.
My test scenario is :

- Inject 1000 messages in the queue.
- Start the application.
- Kill the application when there are about 500 messages in the queue.
- Count messages left in queue and inserted in database.
- Restart the application to empty the queue.

Every time, I execute this scenario I lost a MQ message! But the strange thing about this problem is that the message that disapears from the queue reapears the next day...

In the MQ log, I found those errors:

AMQ7469: Transactions rolled back to release log space. EXPLANATION: The log space for the queue manager is becoming full. One or more long-running transactions have been rolled back to release log space so that the queue manager can continue to process requests. ACTION: Try to ensure that the duration of your transactions is not excessive. Consider increasing the size of the log to allow transactions to last longer before the log starts to become full.

and

AMQ7486: Transaction 0.515122 was preventing log space from being released.

EXPLANATION:
A long running transaction was detected. Message AMQ7469 or AMQ7485 has been
issued indicating if the transaction was rolled back or rolled forward in the
log to allow the log space to be released. The internal transaction identifier
is 0.515122 which can be correlated with 'dspmqtrn -a' output. The transaction
started at 18.28.19 2013-08-01   and first wrote to the queue manager recovery
log at 18.28.19 2013-08-01  . The following transaction context may be useful
in identifying the application causing this behaviour: TRANNUM(0.515122) . This
message can be correllated with the previous AMQ7469 or AMQ7485 message in the
queue manager error logs.
ACTION:
Identify the application responsible for the long running unit of work and
ensure this application is creating and completing transactions in a timely
manner. If the application is working as expected it may be appropriate to
increase the size of the queue manager recovery log.


Websphere MQ does not seem to rollback the transaction when I kill the application. The queue manager keeps it in its recovery log and actually rollback the transaction when the log file is full. At this moment, the message reappears in the queue.

Has someone already encountered this problem?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transactions don't rollback with Websphere MQ

Brett Wooldridge-2
Nothing comes to mind off the top of my head.  You might try enabling debug level
logging in BTM to see if you can correlate transactions between AMQ, the
application and BTM.  I would also suggest asking this over in the MQ forums, as
from the log messages you presented it seems like someone knowledgeable in
MQ configuration may be able to shed light on it.

Regards,
Brett




On Tue, Aug 6, 2013 at 9:25 PM, khaliloo <[hidden email]> wrote:
Hello,

I'm facing a weird problem using Bitronix Transaction Manager with Websphere
MQ and an Oracle database.
My Spring application unstacks MQ messages and inject them in a database
table with a XA transaction.
My test scenario is :

- Inject 1000 messages in the queue.
- Start the application.
- Kill the application when there are about 500 messages in the queue.
- Count messages left in queue and inserted in database.
- Restart the application to empty the queue.

Every time, I execute this scenario I lost a MQ message! But the strange
thing about this problem is that the message that disapears from the queue
reapears the next day...

In the MQ log, I found those errors:

/*AMQ7469*: Transactions rolled back to release log space. EXPLANATION: The
log space for the queue manager is becoming full. One or more long-running
transactions have been rolled back to release log space so that the queue
manager can continue to process requests. ACTION: Try to ensure that the
duration of your transactions is not excessive. Consider increasing the size
of the log to allow transactions to last longer before the log starts to
become full./

and

/*AMQ7486: Transaction 0.515122 was preventing log space from being
released.*

EXPLANATION:
A long running transaction was detected. Message AMQ7469 or AMQ7485 has been
issued indicating if the transaction was rolled back or rolled forward in
the
log to allow the log space to be released. The internal transaction
identifier
is 0.515122 which can be correlated with 'dspmqtrn -a' output. The
transaction
started at 18.28.19 2013-08-01   and first wrote to the queue manager
recovery
log at 18.28.19 2013-08-01  . The following transaction context may be
useful
in identifying the application causing this behaviour: TRANNUM(0.515122) .
This
message can be correllated with the previous AMQ7469 or AMQ7485 message in
the
queue manager error logs.
ACTION:
Identify the application responsible for the long running unit of work and
ensure this application is creating and completing transactions in a timely
manner. If the application is working as expected it may be appropriate to
increase the size of the queue manager recovery log./

Websphere MQ does not seem to rollback the transaction when I kill the
application. The queue manager keeps it in its recovery log and actually
rollback the transaction when the log file is full. At this moment, the
message reappears in the queue.

Has someone already encountered this problem?



--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Transactions-don-t-rollback-with-Websphere-MQ-tp1502.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



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

Re: Transactions don't rollback with Websphere MQ

khaliloo
I found the cause of my problem : My Apache Camel configuration was wrong. It created a transaction for each used resource. Coherence between JMS and database is now ok.

I still have a problem, I got this error when I restart the application after a crash :

[ERROR] 2013-08-08 11:19:30,707 [MPH-DEV] [CAMEL] [main] [RecoveryHelper] : unable to rollback aborted in-doubt branch on resource mphHistoryDataSource - error=XAER_RMERR, extra error=ORA-1031.
 oracle.jdbc.xa.OracleXAException
        at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1135)
        at oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:941)
        at bitronix.tm.recovery.RecoveryHelper.rollback(RecoveryHelper.java:221)
        at bitronix.tm.recovery.Recoverer.rollback(Recoverer.java:471)
        at bitronix.tm.recovery.Recoverer.rollbackAbortedBranchesOfResource(Recoverer.java:447)
        at bitronix.tm.recovery.Recoverer.rollbackAbortedTransactions(Recoverer.java:412)
        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:149)
        at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:87)
        at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:75)
...
Caused by: java.sql.SQLSyntaxErrorException: ORA-01031: privilèges insuffisants

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
        at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:573)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
        at oracle.jdbc.driver.T4CTTIOtxen.doOTXEN(T4CTTIOtxen.java:168)
        at oracle.jdbc.driver.T4CXAResource.doTransaction(T4CXAResource.java:746)
        at oracle.jdbc.driver.T4CXAResource.kputxrec(T4CXAResource.java:809)
        at oracle.jdbc.driver.T4CXAResource.doRollback(T4CXAResource.java:645)
        at oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:936)
        ... 28 more


It says that my database user does not have the privilege to rollback a transaction.
I set privileges to my user like its written here : http://docs.codehaus.org/display/BTM/FAQ#FAQ-WhyisOraclethrowingaXAExceptionduringinitializationofmydatasource
But I still have the exception...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transactions don't rollback with Websphere MQ

Ludovic Orban-2
This may or may not be related but when creating the transactions by a different user than the one performing recovery and not setting the appropriate "FORCE ANY TRANSACTION" privilege you can get this ORA-01031 error.

See http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_xa.htm for reference on that subject.

--
Ludovic


On Thu, Aug 8, 2013 at 11:47 AM, khaliloo <[hidden email]> wrote:
I found the cause of my problem : My Apache Camel configuration was wrong. It
created a transaction for each used resource. Coherence between JMS and
database is now ok.

I still have a problem, I got this error when I restart the application
after a crash :

*[ERROR] 2013-08-08 11:19:30,707 [MPH-DEV] [CAMEL] [main] [RecoveryHelper] :
unable to rollback aborted in-doubt branch on resource mphHistoryDataSource
- error=XAER_RMERR, extra error=ORA-1031.
 oracle.jdbc.xa.OracleXAException
        at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1135)
        at
oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:941)
        at bitronix.tm.recovery.RecoveryHelper.rollback(RecoveryHelper.java:221)
        at bitronix.tm.recovery.Recoverer.rollback(Recoverer.java:471)
        at
bitronix.tm.recovery.Recoverer.rollbackAbortedBranchesOfResource(Recoverer.java:447)
        at
bitronix.tm.recovery.Recoverer.rollbackAbortedTransactions(Recoverer.java:412)
        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:149)
        at
bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:87)
        at
bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:75)
...
Caused by: java.sql.SQLSyntaxErrorException: ORA-01031: privilèges
insuffisants

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
        at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:573)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
        at oracle.jdbc.driver.T4CTTIOtxen.doOTXEN(T4CTTIOtxen.java:168)
        at oracle.jdbc.driver.T4CXAResource.doTransaction(T4CXAResource.java:746)
        at oracle.jdbc.driver.T4CXAResource.kputxrec(T4CXAResource.java:809)
        at oracle.jdbc.driver.T4CXAResource.doRollback(T4CXAResource.java:645)
        at
oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:936)
        ... 28 more
*

It says that my database user does not have the privilege to rollback a
transaction.
I set privileges to my user like its written here :
http://docs.codehaus.org/display/BTM/FAQ#FAQ-WhyisOraclethrowingaXAExceptionduringinitializationofmydatasource
But I still have the exception...




--
View this message in context: http://bitronix-transaction-manager.10986.n7.nabble.com/Transactions-don-t-rollback-with-Websphere-MQ-tp1502p1504.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Loading...