Transaction propagation in DAO!
843854Oct 1 2003 — edited Oct 7 2003Hi Guys,
DAO pattern suggests that connections are obtained in DAOs itself. This means that if I am calling three DAOs from a session facade, there will be three different connections while dealing with database single transaction. Is this understanding correct?
The problem I am facing is - I am unable to make these three calls as one transaction. (Which is a result of three connections involved in the tx).
If I create a connection in session bean and then send it as parameter while calling these three DAOs, it works fine as a single tx. But I think it defeats the purpose of DAO as obtaining the connection should be the responsibility of DAO, not the session bean.
I am sure I am doing something fundamentally wrong. Can someone guide me here please?