Hi

On Thu, Oct 14, 2010 at 4:16 PM, crispyoz [via OpenJPA] <
[email protected]<ml-node%[email protected]>
> wrote:

> Yao please send your persistence.xml, DB and driver details.
>

I figured out the problem.
My Environment:
Openjpa-1.1.0
Glassfish-2.1.1
JDK_1.6.0_21
postgresql-9.0-801.jdbc4.jar

Use a server managed connection pool.
Openjpa schematool work with javax.sql.DataSource,but javax.sql.XADataSource
report a error.

Caused by: org.postgresql.util.PSQLException: Cannot commit when
autoCommit is enabled.
        at 
org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:705)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$ConnectionHandler.invoke(AbstractJdbc23PooledConnection.java:352)
        at $Proxy354.commit(Unknown Source)

Because when I use a Connection.commit it throw a SQLException, and
openjpa catch it.But the XAConnection of postgres use reflect
internally,it wrapped SQLException in a InvocationTargetException.

Finally I got a  java.lang.reflect.UndeclaredThrowableException.

I think this is postgres's bug.

Thanks.

Reply via email to