Sep 24th, 2004, 10:16 AM
How to share a dataSource between OJB DAO and JDBC DAO
In our application, we have a Service that calls OJB DAO's and JDBC DAO's. The service is wrapped with the Transaction Proxy Factory Bean and is configured so a transaction is required.
I assumed that this would mean that all DAO's called by this service would share the same dataSource. Unfortunately, they aren't. I know for a fact that the JDBC DAO and OJB DAO's don't share a connection and it looks like different OJB DAO's don't share a connection.
Since the DAO's don't share a connection, they can't be on the same transaction.
How should I configure the DAO's or the Transaction Proxy Factory Bean to make sure that all database work happens on the same database connection (and therefore the same transaction).