[OJB-developers] J2EE Persistence Manager
Brought to you by:
thma
From: Matthew B. <ma...@so...> - 2002-05-09 00:40:57
|
I'm not sure the JTA J2EE persistence manager is implemented correctly (that is PersistenceBrokerJ2EEImpl.java) Is the assumption that the PersistenceBroker will participate in JTA Transactions, but the Datasource will not? That's currently how it's implemented. The PersistenceBrokerJ2EEImpl calls super.commit which goes through connections and calls .commit, .begin, etc. In the appserver environment, we're not supposed to do that. On a related note, the PersistenceBrokerJ2EEImpl can never work given the current architecture of OJB. Connections are cached and re-used via the connection manager. In the J2EE environment, we should not cache connections, as the app server hands us a connection and associates the proper transaction with it (you aren't even getting a raw connection, just a wrapper). We SHOULD, however cache the datasource we looked up. Then, anywhere we use the connection, we should close it and "release' the resources. it's not really going to release the resources, just let the app server know you are done. Also, give the current design, we'd never be able to make OJB work with XA transactions. Anyway, I've made these changes, but they are quite extensive (28 classes changed, several added). I'm going to be testing over the next week, and hopefully reduce the number of classes changed by making new implementations that are pluggable. For big changes like this, what is the protocol? Whoever wrote the JTA peice, please contact me personally so we can work out some issues. cheers, Matthew |