java - Error: could not inspect JDBC autocommit mode -
i use hibernate , have 1 dao jdbc needed.
in dao use batch.
connection.setautocommit(false); (int = 0; < callslist.size(); i++) { calls calls = callslist.get(i); stmt.setint(1, calls.getsecdur()); /////....... stmt.addbatch(); if ((i+1) % 100 == 0){ stmt.executebatch(); connection.commit(); } } stmt.executebatch(); connection.commit();
and in jpa dao have error could not inspect jdbc autocommit mode
i not understand why, , how solve it, think problem because of connection.setautocommit(false);
error catch in jpa dao
@override public list<e> getall() { list<e> list = null; try { criteria criteria = getsession().createcriteria(entityclass); list = (list<e>) criteria.list(); } catch (exception ex) { logger.log(level.finest, "exception getall message = {1}.", ex.getmessage()); } return list; }
Comments
Post a Comment