Ebean.saveManyToManyAssociations

35 views
Skip to first unread message

pov...@hotelston.com

unread,
Oct 22, 2014, 8:13:07 AM10/22/14
to eb...@googlegroups.com
Hello,

we recently changed ebeanorm version from 3.2.5 to 4.1.6. We have discovered that Ebean.saveManyToManyAssociations method is no longer working. We receive following error:

org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled.
    at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:703)
    at com.jolbox.bonecp.ConnectionHandle.commit(ConnectionHandle.java:564)
    at com.avaje.ebeaninternal.server.transaction.JdbcTransaction.performCommit(JdbcTransaction.java:576)
    at com.avaje.ebeaninternal.server.transaction.JdbcTransaction.commit(JdbcTransaction.java:611)
    at com.avaje.ebeaninternal.server.core.TransWrapper.commitIfCreated(TransWrapper.java:28)
    at com.avaje.ebeaninternal.server.core.DefaultServer.saveManyToManyAssociations(DefaultServer.java:1708)
    at com.avaje.ebeaninternal.server.core.DefaultServer.saveManyToManyAssociations(DefaultServer.java:1692)
    at com.avaje.ebean.Ebean.saveManyToManyAssociations(Ebean.java:593)

with version 3.2.5 it was working without any problems. Could you give us an explanation what might cause this error to occur or how to fix it?

Regards,
Povilas Milgevicius

Rob Bygrave

unread,
Oct 22, 2014, 3:51:52 PM10/22/14
to ebean@googlegroups
It seems that the jdbc connection pool being used is configured to be autoCommit = true ?  Is that the case?

In general Ebean is expecting the connections to be autoCommit = false in order to support transactions. There were changes in 4.x around how to deal with using autoCommit = true type jdbc transactions so perhaps that is the issue.  Can you confirm if you are using autoCommit = true ?



Cheers, Rob.



--

---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages