ORMLite + Transactions -


i have problem understanding default behavior of daomanager.

daomanager.createdao(connectionsource, theclass); 

this takes connectionsource - not connection. if following:

transactionmanager.callintransaction(     localconnection,     connectionsource.getdatabasetype(),     new callable<void>() {         public void call() throws exception {             dao.create(user);             dao.create(player);                 return null;             }     }); 

the transaction should limited single connection (the localconnection). how dao handle that? or not handle @ all?

thx!

the transaction should limited single connection (the localconnection). how dao handle that? or not handle @ all?

hrm. i'm not 100% sure why connection method exposed. i'm going deprecate it.

you should using dao.callbatchtasks(...) method. if need use transactionmanager directly, i'd use method takes connectionsource, not connection.

you can take @ source of transactionmanager.callintransaction(...) see saving connection used dao later through ormlite magic. auto-commit disabled on saved connection , restored after batch tasks complete.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -