Results 1 to 2 of 2

Thread: Using Hibernate and jdbcTemplate together

  1. #1
    Join Date
    Mar 2012
    Posts
    4

    Default Using Hibernate and jdbcTemplate together

    Hi,

    in the same application I have defined one datasource.

    This datasource is using by hibernate (by org.springframework.orm.hibernate3.LocalSessionFac toryBean) and by jdbcTemplate (so without Hibernate). Can I do this? Can this give me problems?

    For example: I have a transaction manager for hibernate (HibernateTransactionManager) and a transaction manager for jdbcTemplate (DataSourceTransactionManager) and if I use them for annotation I can't use both of them:

    <tx:annotation-driven transaction-manager="txManager"/>

    Any idea?

    Thanks

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

    Default

    You don't need 2 transactionmanager you only need the HibernateTransactionManager...
    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
  •