Results 1 to 3 of 3

Thread: Transactions on Spring 2.0

  1. #1

    Default Transactions on Spring 2.0

    Hello there! I have a few questions regarding Transactions on Spring 2.0, hope you guys help me out.

    1st. When using @Transactional attribute, I know annotations are not inherited, but we use templates here, so for example:
    Code:
    public class CrudService {
     @Transactional(propagation = Propagation.REQUIRED)
     public void save(T entity){...}
    }
    
    public class SpecialCrudService extends CrudService{
     @Transactional(propagation = Propagation.MANDATORY)
     //overridden method
     public void save(T entity){...}
    }
    
    }
    Will the above work? Will spring respect the new transaction behavior for the new subclass?

    2nd. Is it possible (inside a full jee container like JBoss, or using JOTM) to have JTA transactions that spam multiple resources (JMS and Databases for example)? Will Spring JTA transactions support deal within it? My architecture is based on ActiveMQ for the JMS and MDP

    Best Regards

    Vinicius

  2. #2
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    Quote Originally Posted by viniciuscarvalho View Post
    2nd. Is it possible (inside a full jee container like JBoss, or using JOTM) to have JTA transactions that spam multiple resources (JMS and Databases for example)? Will Spring JTA transactions support deal within it?
    Why not? Set up correctly (JtaTransactionManger) there should be no problem. Any reason you put it into question?

    Jörg

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

    Default

    2nd. Is it possible (inside a full jee container like JBoss, or using JOTM) to have JTA transactions that spam multiple resources (JMS and Databases for example)? Will Spring JTA transactions support deal within it? My architecture is based on ActiveMQ for the JMS and MDP
    Yes. Spring doesn't implement transaction capabilities, it just drives the transaction. This means that if your transaction manager can handle multiple datasources, Spring will drive the tx over all the datasources enlisted with the JTA TM.
    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
  •