Announcement Announcement Module
Collapse
No announcement yet.
Toplink SessionEvent handling and Spring declarative tx Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Toplink SessionEvent handling and Spring declarative tx

    We're experiencing an UnexpectedRollbackException at the moment that a runtimeexception is thrown in a method that implements oracle.toplink.sessions.SessionEventLister.prepare UnitOfWork(SessionEvent e)
    These toplink sessioneventlisteners plug in to the applicationservers JTS transactionmanagement to commit toplink UnitOfWork instances.

    I get the impression that Spring AbstractPlatformTransactionManager expects to have total knowledge on exceptions that occur and does not expect/tolerate exceptions to occur at the moment of calling UserTransaction.commit() in AbstractPlatformTransactionManager.commit(Transact ionStatus status)

    We are not using the Spring toplink integration. Does this mean that we should?

    groeten uit Holland,
    Joost de Vries

    ps

    Appserver: OC4J 10.1.2
    Stateless Sessionbeans with BMT
    ORM: Toplink 9.0.4.6

  • #2
    Hi Joost

    What are you doing in the prepareUnitOfWork callback? I'm assuming that you're using the JtaTransactionManager and that the TopLink ServerSession is configured to use an ExternalTransactionController.

    Does this problem also occur in a J2SE environement or is it specific to when you are synchronizing with a JTA transaction?

    BTW, if you're using Spring and TopLink together, I would definately recommend that you use the TopLink integration.

    Comment


    • #3
      Search the forum for UnexpectedRollbackException - you will find some threads with explanations. If they are not enough or helpful I suggest you use the dev mailing list.

      Comment


      • #4
        Hi guys,

        Thanks for the feedback.
        In the meantime we solved the problem by not doing any handling on the SessionEvent anymore. We're calling the same handling now from a our own extension of TransactionAspectSupport.

        We used this SessionEvent to call a 'validate' method on all changed instances.
        Naturally this could lead to exceptions.

        slimslenderslacks: yes, we use JtaTransactionManager and the TopLink ServerSession is configured to use an ExternalTransactionController.

        I'm still not quite convinced that we need the toplink integration part of Spring Data Access. We do not want to use Spring templates because they're too intrusive for our purposes.
        Maybe it's useful for some toplink configuration...

        Thanks for the tip Costin. I will do that.

        cheers,
        Joost

        Comment

        Working...
        X