From: | Aaron Mulder <ammulder(at)alumni(dot)princeton(dot)edu> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: XA capable driver |
Date: | 2002-08-01 06:50:34 |
Message-ID: | Pine.LNX.4.44.0208010241580.11193-100000@gentoo.CS.Princeton.EDU |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
If it was a DB problem, why would JBossMQ (the JBoss JMS
implementation) be the one throwing an exception? In a 2-phase commit
session, you first prepare all the resources (DB & MQ), then if that all
works, you commit. Here the prepare on the MQ fails -- there's no error
from the DB. You need to find out why the SpyMQResource is failing to
prepare on line 169. I think XAER_RMERR is a generic "Resource Manager
Error" message, so it's not obvious what is causing it. Also it happens
at the end of the TX, which is why it manifests "after the method has
fully completed".
In any case, since there are no database errors below, please
reply off-list.
Aaron
On Thu, 1 Aug 2002, G.L. Grobe wrote:
> > 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());
> }
> }
> }
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
From | Date | Subject | |
---|---|---|---|
Next Message | natesan kirubakaran | 2002-08-01 16:27:08 | Creating a PostgreSql Connection Pool in Tomcat3.2 |
Previous Message | G.L. Grobe | 2002-08-01 06:13:05 | Re: XA capable driver |