Java MySQL calling commit() on a large EntityTransaction object failed -
i have big javax.persistence.entitytransaction object, ent, when called method commit() on object (to insert new record (mysql) table: ent.commit();
i got quere error (please see below). think problem relates size of entitytransaction object, because smaller size (4k, 5m, 9m) calls succeeds new records inserted table. size of entitytransaction object caused failure 15m, not big (i guess) because utilize longblob columns.
any help, pointer or advice highly appreciated.
please help!
thanks,
tri
================================== code:
public static boolean inserttransaction(transaction tran) { em.gettransaction().begin(); if (!em.contains(tran)) { system.out.println("dbmanager.inserttransaction persist"); em.persist(tran); system.out.println("dbmanager.inserttransaction persist returned"); } else { system.out.println("dbmanager.inserttransaction merge"); em.merge(tran); } system.out.println("dbmanager.inserttransaction commit"); em.gettransaction().commit();////>>>>>>>>>>>>>failure happened here big object system.out.println("dbmanager.inserttransaction commit returned"); homecoming true; }
================================== output:
dbmanager.inserttransaction commit [el warning]: 2013-02-07 16:53:08.947--unitofwork(13583728)--exception [eclipselink-4002] (eclipse persistence services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.databaseexception internal exception: com.mysql.jdbc.exceptions.jdbc4.communicationsexception: communications link failure exception in thread "awt-eventqueue-0" java.lang.nullpointerexception lastly packet received server 234 milliseconds ago. lastly packet sent server 234 milliseconds ago. error code: 0 call: insert transaction_tbl (tnc, dest, rtcn, src, status, time_stamp, tran_file, tran_file_size, tran_file_type, ttype) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) bind => [10 parameters bound] query: insertobjectquery(com.cmbios.db.client.transactiontbl[ tnc=358cph8ltl ]) [el warning]: 2013-02-07 16:53:08.95--clientsession(10091188)--exception [eclipselink-4002] (eclipse persistence services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.databaseexception internal exception: com.mysql.jdbc.exceptions.jdbc4.mysqlnontransientconnectionexception: no operations allowed after connection closed.connection implicitly closed driver. error code: 0 [el warning]: 2013-02-07 16:53:08.95--unitofwork(13583728)--java.lang.nullpointerexception @ org.eclipse.persistence.sessions.server.serversession.setcheckconnections(serversession.java:814) @ org.eclipse.persistence.sessions.server.connectionpool.releaseconnection(connectionpool.java:285) @ org.eclipse.persistence.sessions.server.serversession.releaseclientsession(serversession.java:762) @ org.eclipse.persistence.sessions.server.clientsession.release(clientsession.java:555) @ org.eclipse.persistence.internal.jpa.transaction.entitytransactionimpl.commitinternal(entitytransactionimpl.java:99) @ org.eclipse.persistence.internal.jpa.transaction.entitytransactionimpl.commit(entitytransactionimpl.java:63) @ com.cmbios.db.client.dbmanager.inserttransaction(dbmanager.java:137)
java mysql persistence commit large-data
No comments:
Post a Comment