Announcement Announcement Module
Collapse
No announcement yet.
how to make transaction / hibernate session always available Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    It needs adjustment

    Well, I created transaction wrappers for the code bellow

    Code:
     validator.validate(request);
     Domain domain=mapper.mapToDomain(request);
     program.exec(domain);
     mapper.mapFromDomain(request,domain);
    It is one Java class TransactionOrchestrator and around 100 beans. Each has its own validator, mapper and program (what is analog to more common service).

    Yes it works. One transaction per call. TransactionOrchestrator.orchestrate is the only API that is advised. StrutsAction is calling this API to handle a request.

    Nevermind. It took few days to adjust all the things but it works now. I wish Spring had an option to bound transaction to the thread by default and deviate in case if some API really needs a new one. But it is done how it is done.

    Thanks a lot for the discussion.
    Last edited by Sokolov; Dec 28th, 2010, 11:35 AM.

    Comment


    • #17
      If you believe that such option is desirable, create a feature request in the Spring JIRA.

      Comment

      Working...
      X