Hello,
I manage the transactions manually using
DaoManager
My code looks like this:
class BaseService{
private static BaseDAO baseDao =
null;
static {
//get Base DAO
baseDao = (BaseDAO)DaoConfig.getDaomanager().getDao(BaseDAO.class);
}
static {
//get Base DAO
baseDao = (BaseDAO)DaoConfig.getDaomanager().getDao(BaseDAO.class);
}
....
..
.....
}
Class MyService extends
BaseService{
private DaoManager daoManager =
DaoConfig.getDaomanager();
private MyService() {
myDAO=(MyDAO) daoManager.getDao(MyDAO.class);
}
myDAO=(MyDAO) daoManager.getDao(MyDAO.class);
}
public void insert(){
try{
daoManager.startTransaction();
genricInsert(); //This
method uses myDao object.
super.updateProperities();
//Calls the base service method which sues baseDao
super.updateRelatedProps(); //Calls the
base service method which sues baseDao
delete();
//This method uses myDao object.
daoManager.commitTransaction();
}
finally{
daoManager.endTransaction();
}
}
The above functions genericInsert(),updateProperities()
,updateRelatedProps() and delete() calls the Stored procedure to do the
job.The above SPs do not commit the operations done.
But daoManager.commitTransaction() does not commit the
transactions and none of the operations done by the functions are commited in
the backend.
I don not know what is wrong with the above code snippet.
Can any one help me to solve the above problem?
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated..
