3 Replies Latest reply on Nov 26, 2007 1:38 PM by youngm

    Spring DAO and Seam

    Shawn Garner Newbie

      Is it possible to use Spring JDBC DAO/Template instead of JPA/EJB/Hibernate?
      What do you give up by doing that?

      Shawn

        • 1. Re: Spring DAO and Seam
          youngm Novice

          I may not be understanding your question entirely but I believe you would use Spring JDBC with Seam the same as you would without Seam since Seam doesn't really provide any kind of JDBC features. The main reason you might want to use Seam's JPA/Hibernate with Spring (the spring+seam integration) is to take advantage of conversation scoped persistence contexts.

          Does that make sense?

          Mike

          • 2. Re: Spring DAO and Seam
            Shawn Garner Newbie

            So could I could define a JDBCTemplate in spring and register it as a seam component and have it have a conversational scope?

            • 3. Re: Spring DAO and Seam
              youngm Novice

              JDBC has no concept of a persistence context. Conversation scoped persistence contexts are only valuable with Hibernate and JPA. If you just want to use JDBCTemplate in a Seam component then just define the JDBCTemplate in your spring file and inject it into a Seam component using

              @In("#{jdbcTempalte}")

              Mike