Announcement Announcement Module
Collapse
No announcement yet.
EJB transaction and Spring templates Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • EJB transaction and Spring templates

    Hi,
    Can I use jdbcTemplate or HibernateTemplate or support under SLSB transaction hood? ( for example company need expose to remote EJB client), I like the spring handle exception.


    Ping

  • #2
    Yes. You could also consider using Spring tx mgt and making the bean BMT, but you can use EJB CMT fine.

    Comment


    • #3
      I like your second suggestion, you know "political" presure to use EJB, so I can used "EJB" with everything spring under it.

      Comment


      • #4
        EJB remoting + Spring declarative tx mgt works very well. That way you get Spring's "rollback rule" support, meaning that automatical rollback can work for checked exceptions without propagating an EJBContext through POJO delegates, making them harder to test. Less invasive: transaction management is purely driven through pure Java message signatures.

        Comment


        • #5
          The only ramification I have encountered to using the BMT approach is that your EJB will not be able to be called by another EJB and participate in that bean's transaction. In the section on bean-managed transaction demarcation the EJB spec says "When a client invokes a business method via the enterprise beanís home or component interface, the Container suspends any transaction that may be associated with the client request."
          In my testing, if I had a CMT bean call my Spring transaction bean fronted by a BMT, a rollback initiated in the called bean did not cause a rollback of the caller. This may or may not be an issue for you.
          If my understanding of the scenario is not correct, please let me know.

          Comment

          Working...
          X