Results 1 to 2 of 2

Thread: Can I write multiple TransactionProxyFactoryBean in single applicationContext.xml fil

  1. #1
    Join Date
    Mar 2011
    Posts
    2

    Default Can I write multiple TransactionProxyFactoryBean in single applicationContext.xml fil

    I have two different beans, for one I have written

    For Bean 1.

    TransactionProxyFactoryBean
    HibernateTransactionManager
    LocalSessionFactoryBean
    and the bean class also.

    I want to know that, can I write second set of bean in the same ApplicationContext.xml file. Like this.

    For Bean 2

    TransactionProxyFactoryBean
    HibernateTransactionManager
    LocalSessionFactoryBean
    and the bean class also.

    If yes, please give me some example. Please let me know.

    Thanks.
    Attached Files Attached Files
    Last edited by ven12344; Jul 24th, 2012 at 07:14 PM.

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

    Default

    Please use [ code][/code ] tags when posting code.

    You can write as many as you want or need however it is not something you want nor should do as the TransactionProxyFactoryBean is deprecated. Also why on earth would you need multiple transactionmanagers and sessionfactories?! In general you need one if you connect to multiple databases you need several but then you also want to use jta (for cross resource transactions).

    For transactions I suggest a read of the transaction and aop chapter of the reference guide and learn how to use aop:config with tx:advice or tx:annotation driven as both are a better alternative as opposed to the TransactionProxyFactoryBean.
    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

Posting Permissions

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