Re: XA capable driver - Mailing list pgsql-jdbc

From G.L. Grobe
Subject Re: XA capable driver
Date
Msg-id 004d01c23922$801498e0$0500a8c0@trinity
Whole thread Raw
In response to Re: XA capable driver  (Aaron Mulder <ammulder@alumni.princeton.edu>)
Responses Re: XA capable driver
List pgsql-jdbc
> If there's any "postgresql" in the error/warning/stack trace,
> please post it here.  Otherwise, perhaps you could just e-mail it to me
> off-list.

Ok, I've included the output below as well as the code that's exec'ing below
that. Note that no exceptions are thrown while exec'ing the code as shown. I
didn't see anything that actually came from postgres itself. This output
came from JBoss 2.4.4 and it's been unanimous from the JBoss forums that
this is a problem of the driver not being XA capable. This all seems to
happen after the method has fully completed and is called from within a MDB.

[WARN,TxCapsule] XAException: tx=XidImpl [FormatId=257,
GlobalId=cassia//182, BranchQual=] errorCode=XAER_RMERR
javax.transaction.xa.XAException
        at org.jboss.mq.SpyXAResource.prepare(SpyXAResource.java:169)
        at org.jboss.tm.TxCapsule.prepareResources(TxCapsule.java:1411)
        at org.jboss.tm.TxCapsule.commit(TxCapsule.java:330)
        at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:76)
        at
org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:314)
        at
org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageCons
umer.java:565)
        at
org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:376)
        at org.jboss.mq.SpySession.run(SpySession.java:248)
        at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:172)
        at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.ja
va:728)
        at java.lang.Thread.run(Thread.java:484)
[WARN,TxCapsule] XAException: tx=XidImpl [FormatId=257,
GlobalId=cassia//182, BranchQual=] errorCode=XAER_RMERR
javax.transaction.xa.XAException
        at org.jboss.mq.SpyXAResource.rollback(SpyXAResource.java:201)
        at org.jboss.tm.TxCapsule.rollbackResources(TxCapsule.java:1540)
        at org.jboss.tm.TxCapsule.commit(TxCapsule.java:347)
        at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:76)
        at
org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:314)
        at
org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageCons
umer.java:565)
        at
org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:376)
        at org.jboss.mq.SpySession.run(SpySession.java:248)
        at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:172)
        at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.ja
va:728)
        at java.lang.Thread.run(Thread.java:484)
[ERROR,StdServerSession] failed to commit/rollback
javax.transaction.RollbackException: Unable to commit, tx=XidImpl
[FormatId=257, GlobalId=cassia//182, BranchQual=] status=STATUS_ROLLEDBACK
        at org.jboss.tm.TxCapsule.commit(TxCapsule.java:351)
        at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:76)
        at
org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:314)
        at
org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageCons
umer.java:565)
        at
org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:376)
        at org.jboss.mq.SpySession.run(SpySession.java:248)
        at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:172)
        at
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.ja
va:728)
        at java.lang.Thread.run(Thread.java:484)

--------------
     try {
         dbConn = getConnection();

         update = "UPDATE Tasks SET state = ?, end_time = "
            + "(SELECT CURRENT_TIMESTAMP), errors = ?, warnings = ? "
            + "WHERE build_id = ?";

         pstmt = dbConn.prepareStatement(update);

         pstmt.setInt(1, (int) bInfo.getStatus());
         pstmt.setInt(2, (int) bInfo.getErrors());
         pstmt.setInt(3, (int) bInfo.getWarnings());
         pstmt.setInt(4, (int) bInfo.getBuildId());

         log.debug(Manager.class, update);

         int rcnt = pstmt.executeUpdate();
      }
      catch (SQLException sqle) {
         log.error(Manager.class, sqle.getMessage());
         sqle.printStackTrace();
      }
      catch (Exception e) {
         log.error(Manager.class, e.getMessage());
         e.printStackTrace();
      }
      finally {
         try {
            if (pstmt != null)
               pstmt.close();
         }
         catch (Exception e) {
            log.error(Manager.class, e.getMessage());
         }

         try {
            if (dbConn != null)
               dbConn.close();
         }
         catch (Exception e) {
            log.error(Manager.class, e.getMessage());
         }
      }
   }




pgsql-jdbc by date:

Previous
From: Aaron Mulder
Date:
Subject: Re: XA capable driver
Next
From: Aaron Mulder
Date:
Subject: Re: XA capable driver