Hi,
I have a doubt on DAOs and Connection handling...
In my
application, I have a Session Faccade (Stateless Session Bean) which accesses a
Business Object which in turn calls about three Data Access Objects to perform
the database operations. The transaction attribute for the method is the Session
Bean is set as "Required". The application uses a DataSource for obtaining the
Database Connection. All the three DAOs are using separate connection
objects.
My doubts are:
1. If I roll back the transaction at any stage
will all the three connections get rolled back?
2. Is it a good idea to
obtain separate connections for the DAOs that are taking part in same
transaction? Or I should create a connection outside the DAOs and pass it to all
the DAOs.
3. Is DataSource.getConnection() an expensive call that will
degrade the application performance.
Somebody please
help....
Thanks & Regards