I'm interested in any ideas people have as to how I can integrate transactions in an object database (Versant) with the JBoss EJB container. We plan on using stateless session beans for our business logic. Here are the options I have come up with so far (none of them particularly palatable):
1. Use Bean Managed Transactions and put the Versant transaction calls in with the user transaction calls. This means writing every method with a transaction wrapper which is a lot of code even if the transaction code goes in a superclass to our bean classes. It also means that two phase commit is impossible.
2. Use container managed persistence with stateful session beans implementing the SessionSynchronization interface and put the versant transaction code in the afterBegin(), beforeCompletion() and afterCompletion() methods. This allows 2 phase commit but it means that we have to use stateful session beans which makes clustering more tricky.
3. Use a JDO implementation to link the two products properly. This seems to me to introduce a great deal of risk (and cost!) with the immaturity of JDO. I'm also concerned about the performance of adding an extra layer to the architecture although it does buy us some portability. There may also be some extra coding involved in doing the persistence over versant persistence, I'm not sure.
Would anyone care to suggest other alternatives I may have missed or other factors to take into account ?