Close the connection after each transaction... that was the only workaround
i was suggested to use ... and it works fine! However, i've not tested yet
the impact of opening/closing the connection for each transaction ...
--hermann
----- Original Message -----
From: "Jure Lodrant" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 02, 2001 2:41 PM
Subject: [JBoss-user] Postgres commit problem
> I'm trying to set up a server using Jboss 2.2.2 and Postgres 7.1.2 on
Linux.
>
> I've compiled samples to test jboss-postgres connection. Some ran fine,
some
> not at all, as far as I can tell all due to transactions not commiting
when
> they should. UPDATE statements seem to be mostly affected.
>
> Running a simple client to update a row in a table through an entity bean
> with container managed transactions leaves the postgres backend in (idle
in
> transaction) state, which essentialy means the transaction has not
commited.
>
> Checking the state of the row through Jboss show the update as succesful,
> where in fact (looking through psql console), no update (and commit) has
> taken place.
>
> At the same time, when closing a DB connection from a session bean, I get
an
> exception like this:
> ------------------------------------------------------------------
> [BankBean] TRANSACTION ROLLBACK EXCEPTION:null; nested exception is:
> javax.ejb.EJBException
> [BankBean] java.lang.RuntimeException: Unable to deregister with
> TransactionManager: java.lang.IllegalArgumentException: xaRes not enlisted
> [BankBean] at java.lang.Throwable.<init>(Throwable.java:96)
> [BankBean] at java.lang.Exception.<init>(Exception.java:44)
> [BankBean] at
java.lang.RuntimeException.<init>(RuntimeException.java:49)
> [BankBean] at
>
org.opentools.minerva.jdbc.xa.XAConnectionFactory$2.closeConnection(XAConnec
tionFactory.java:103)
> [BankBean] at
>
org.opentools.minerva.jdbc.xa.XAConnectionFactory$2.connectionClosed(XAConne
ctionFactory.java:82)
> [BankBean] at
>
org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl.clientConnectionClose
d(XAConnectionImpl.java:126)
> [BankBean] at
>
org.opentools.minerva.jdbc.xa.wrapper.XAClientConnection.close(XAClientConne
ction.java:250)
> [BankBean] at bank.BankEJB.ejbRemove(BankEJB.java:75)
> [BankBean] at java.lang.reflect.Method.invoke(Native Method)
> [BankBean] at
>
org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.removeSession(St
atefulSessionFilePersistenceManager.java:320)
> [BankBean] at
>
org.jboss.ejb.StatefulSessionContainer.remove(StatefulSessionContainer.java:
334)
> [BankBean] at java.lang.reflect.Method.invoke(Native Method)
> [BankBean] at
>
org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulS
essionContainer.java:548)
> [BankBean] at
>
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:19
0)
> [BankBean] at
>
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSess
ionInstanceInterceptor.java:209)
> [BankBean] at
>
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
> [BankBean] at
>
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
java:263)
> [BankBean] at
> org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
> [BankBean] at
> org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
> [BankBean] at
>
org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:
326)
> [BankBean] at
>
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI
nvoker.java:392)
> [BankBean] at java.lang.reflect.Method.invoke(Native Method)
> [BankBean] at
> sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:242)
> [BankBean] at sun.rmi.transport.Transport$1.run(Transport.java:155)
> [BankBean] at java.security.AccessController.doPrivileged(Native
Method)
> [BankBean] at
sun.rmi.transport.Transport.serviceCall(Transport.java:152)
> [BankBean] at
> sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:462)
> [BankBean] at
>
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:6
62)
> [BankBean] at java.lang.Thread.run(Thread.java:498)
> ----------------------------------------------------------------
> I've seen a similiar question in this list, but no noticed no solution.
>
> I've build the postgresql driver in different configurations, tried a
bunch
> of different settings in jboss.jcml, with no apparent effect.
>
> My PostgresDS MBean config:
> ------------------------------------------------
> <mbean code="org.jboss.jdbc.JdbcProvider"
> name="DefaultDomain:service=JdbcProvider">
> <attribute
>
name="Drivers">org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,org.
postgresql.Driver</attribute>
> </mbean>
>
> <mbean code="org.jboss.jdbc.XADataSourceLoader"
> name="DefaultDomain:service=XADataSource,name=PostgresDB">
> <attribute
>
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImp
l</attribute>
> <attribute name="PoolName">PostgresDS</attribute>
> <attribute name="URL">jdbc:postgresql://leteci/test</attribute>
> <attribute name="JDBCUser">postgres</attribute>
> <attribute name="Password">postgres</attribute>
> </mbean>
> --------------------------------------------------
> Maybe someone send me his jboss.jcml with postgresql configured, and some
> working jboss.xml example.
>
> Big thanks in advance,
>
> Jure
>
> .
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user