Thanks for the reply, I now understand more about the different ack-modes.
However, my problem still remains. In order to get more to get more control of
all commits and rollbacks I tried BMT instead, with the following code structure
| public void onMessage(Message m) {
| log.debug("Start onMessage()");
| try {
| log.debug("Starting transaction");
| context.getUserTransaction().begin();
| } catch (Exception e) { log.error("Failed to start transaction"); }
| try {
| // do something that might fail
| } catch (HandledException he) {
| log.info("Caught HandledExcption, rolling back transaction")
| try {
| context.getUserTransaction().rollback();
| } catch (Exception e) {
| log.error("Failed to rollback transasction " + e.toString());
| }
| return;
| } catch (IgnoredException ie) {
| log.error("Caught IgnoredException, ignoring");
| }
| log.debug("Commiting transaction");
| try {
| context.getUserTransaction().commit();
| } catch (Exception e) {
| log.error("Failed to commit transasction: " + e.toString());
| }
| log.debug("End onMessage()");
| }
|
And again, in the normal case, i.e. no exception is thrown it works ok and the
transaction is commited. But if I provoke a IgnoreException the out put would
be the following:
| DEBUG Start onMessage()
| DEBUG Starting transaction
| ERROR Caught IgnoredException, ignoring
| DEBUG Commiting transaction
| ERROR Failed to commit transaction: javax.transaction.RollbackException:
Already marked for rollback
|
|
| Why would the transaction already be marked for rollback in this case? I'm
thinking there might be some transaction timeout? In my case it's a quite long
transaction, +1 min.
|
| Does anyone have any idea on what might be going on here?
|
| Tnx
|
| /Andreas
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3904591#3904591
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3904591
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user