Results 1 to 2 of 2

Thread: Programmatic Transaction Management?

  1. #1
    Join Date
    Dec 2005
    Posts
    3

    Question Programmatic Transaction Management?

    Is it possible to programmatically manage local Hibernate transactions in the layer above your Spring-managed, declarative AOP Service objects?

    For example, say you've got two Spring-managed beans A, and B both of which have declarative transactions applied to them in the Spring context. If you're in a Struts action, for example, and you want a single transaction to encompass both the calls on A and B without requiring the Struts action be managed by Spring how can you accomplish this? I.E. what transaction object do you use, how do you get a reference to it, etc.

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    In order for Spring to apply transactions on A and B it has to manage them. If you want to use the objects inside Struts you have to get a hold of them from Spring context and you can do that through the Struts integration (which you can find more about inside the documentation). Even though the transaction of A and B it's started declaratively you can add code in a programatical way from your code through TransactionTemplate. See again the reference documentation for more details (http://static.springframework.org/sp....html#d0e5591).
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •