Results 1 to 3 of 3

Thread: Jtatrasactionmanager without container managed resources

  1. #1

    Default Jtatrasactionmanager without container managed resources

    Hi all,

    Sorry for spamming again but i am stuck at this point in the half way
    Plz help me.

    I am using 2 Session factories in my application As following. With Jtatrasactionmanger (As i need to perform DB operation on those two databases at the same time (Kind of replication of data))
    Code:
    <bean id="firstSessionFactory" class="org.springframework.orm.hibernate3LocalSessionFactoryBean">
    .
    .
    .
    </bean>
    <bean id="secondSessionFactory" class="org.springframework.orm.hibernate3LocalSessionFactoryBean">
    .
    .
    .
    </bean>
    
    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" >
    This is working obsolutely fine when i deploy it on Jboss -- I am exposing Web services here.

    But when i use testNg to unit test the application it is throwing exceptions.

    If i include jta.jar then it says

    Code:
    java.lang.IllegalStateException: Either 'userTransaction' or  'userTransactionName' or 'transactionManager' or 'transactionManagerName' must be specified
    otherwise i get
    Code:
    NoClassDefFoundError: javax/transaction/TransactionManager ......
    Any help in this regard is appreciated...

    thanks in advance..

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    If you want to test you will need a JtaTransactionmanager which runs without a container. Take a look at JOTM for that purpose.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3

    Default If you want to test you will need a JtaTransactionmanager ---(JOTM)

    Thank you very much.. I will be trying out with JOTM.

Posting Permissions

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