Does anyone know of a good technique or pattern to allow DAO objects to particpate in transactions?
Currently our DAO's (written just like SUN's DAO example from the Core J2EE Pattern) do not have the capability of particpating in a transaction. They all operate independently of each other, each getting their own connection when they need one. Its a great abstraction for client code, until an all or nothing scenario arises.
Of course, our DAO clients could obtain and pass the particpating DAO's a java.sql.Connection, but we would like to hide any Connection details from the client code and not have them worrying with starting, commiting and rolling back transactions.
Thanks in advance for any thoughts.