-
1. Re: Problem with DAO Design Pattern
sudsm Apr 28, 2004 9:41 AM (in response to prasanna_vashisht)Hope this reply is not too late! ;)
Your problem has nothing to do with DAO pattern. You need to set the autocommit property to false on the Connection. -
2. Re: Problem with DAO Design Pattern
mikeydavison May 11, 2004 12:33 PM (in response to prasanna_vashisht)How exactly are you getting your connection? If you've configured your connection in a manner similar to the example (oracle-ds.xml) and you're getting the connection from a DataSource stored in the JNDI tree, there's no need to touch the autocommit property of the connection.
Are you throwing a RemoteException or RuntimeException from your bean method call? Doing so should trigger a rollback provided that the connection is obtained properly. -
3. Re: Problem with DAO Design Pattern
puneetjains Jun 2, 2004 5:00 AM (in response to prasanna_vashisht)if u r using session beans to call dao then the transaction initialtor is ur session bean
write mySessionCtx.setRollbackOnly(); in the catch block of the method inside the session bean
it will roll back any modifications int he database.
make sure that the method invicoition on the session bean has requeired transaction atribute -
4. Re: Problem with DAO Design Pattern
puneetjains Jun 2, 2004 5:00 AM (in response to prasanna_vashisht)if u r using session beans to call dao then the transaction initialtor is ur session bean
write mySessionCtx.setRollbackOnly(); in the catch block of the method inside the session bean
it will roll back any modifications int he database.
make sure that the method invicoition on the session bean has requeired transaction atribute