remove logger

206 views
Skip to first unread message

Mouhamad Arafeh

unread,
Feb 24, 2015, 4:58:43 AM2/24/15
to sq...@googlegroups.com
this appear on console when trying to add same primary key 

710 [main] WARN org.sql2o.logging.SysOutLogger - Could not roll back transaction. message: {}
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Can't call rollback when autocommit=true
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
at com.mysql.jdbc.Connection.rollback(Connection.java:5257)
at org.sql2o.Connection.rollback(Connection.java:115)
at org.sql2o.Connection.onException(Connection.java:56)
at org.sql2o.Query.executeUpdate(Query.java:526)
at socialconnection.SConnection.registerUserToGroup(SConnection.java:67)
at socialconnection.User.registerToGroup(User.java:75)
at network.Network.main(Network.java:29)
BUILD SUCCESSFUL (total time: 1 second)

how to remove it?

Lars Aaberg

unread,
Mar 1, 2015, 10:14:53 AM3/1/15
to sq...@googlegroups.com
Hi,

Apparently sql2o calls the rollback method when an exception occurs. This in turn causes MySQL to throw another exception because it does not allow rollback to be called when autocommit is enabled. 

You could try to execute your statement in a transaction. This will cause autocommit to be disabled.

Regards
Lars Aaberg 

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

Mike Sims

unread,
Mar 8, 2017, 11:24:49 AM3/8/17
to sql2o
For me, the 'auto increment' option was not set on the key field. Once I set it, it worked fine.
Reply all
Reply to author
Forward
0 new messages