8 Replies Latest reply on Sep 30, 2009 4:46 PM by luxspes

    Seam - ibatis

    thejavafreak

      Dear all,


      In some cases our team think that Hibernate is not suitable to use such as dealing with legacy database and in that case we think that ibatis would be much more suitable. Has anyone doing an integration between Seam and ibatis here? Could you share your experience here with us?


      Many thanks

        • 1. Re: Seam - ibatis
          mail.micke

          Hi


          We're using iBATIS with Seam.


          We're not doing anything special at all, we define our DAOs in Spring and simply inject them into our Seam components (actually using loads of services this way since we are slowly migrating from Spring/Struts to JSF/Seam).


          Can't give you any Seam specific integration information, just figured I'd reply anyway :)


          Cheers,
          micke

          • 2. Re: Seam - ibatis

            Another team where I work is also using Seam + Spring + Ibatis (they need to integrate with a system with lots of legacy stored procedures).


            I also can't give you any Seam specific integration information, but I just figured I'd reply anyway (so that you know others are doing it too, I guess)


            • 3. Re: Seam - ibatis
              thejavafreak

              Mikael Andersson wrote on Aug 05, 2008 23:49:


              Hi

              We're using iBATIS with Seam.

              We're not doing anything special at all, we define our DAOs in Spring and simply inject them into our Seam components (actually using loads of services this way since we are slowly migrating from Spring/Struts to JSF/Seam).

              Can't give you any Seam specific integration information, just figured I'd reply anyway :)

              Cheers,
              micke


              hi mikael,


              Thanks for the quick response. Well I actually wanted to see how can we integrate ibatis with seam without using spring. Does Seam provide an abstraction so we can glue other persistence framework with Seam?

              • 4. Re: Seam - ibatis
                admin.admin.email.tld
                I'm not sure if the Java Persistence API supports stored proc calls like JDBC does.  But you could always use JDBC for your CRUD if you have to (code is messy and ugly compared to JPA/Hibernate).

                I haven't seen any examples of Seam + iBATIS...
                • 5. Re: Seam - ibatis
                  mail.micke

                  Hi


                  You should be able to simply create JSF/Seam managed beans (your DAOs) instead of Spring managed ones.


                  The only draw back that I can think of by not using Spring is that there are some nice base classes in Spring which you can't use (SqlMapClientDaoSupport, SqlMapClientFactoryBean) .
                  But implementing something similar to this yourself shouldn't be a big problem.


                  Cheers,
                  micke

                  • 6. Re: Seam - ibatis
                    accless

                    If u use ibatis without spring in an application server (AS), you have to manage the transactions yourself, right? this will be hard work...


                    In my opinion u should use spring and ibatis in combination. Then, the only glue-work has to be done with spring and seam. But there exists some documentation in the seam ref



                    greetings


                    • 7. Re: Seam - ibatis
                      asookazian

                      any specific good/bad experiences with Seam and ibatis?

                      • 8. Re: Seam - ibatis

                        I have tried with:



                        1. Seam + IBATIS

                        2. Seam +SpringJDBC

                        3. Seam +JDBC




                        And by far, the most comfortable experience was Seam +SpringJDBC, if you go for Seam + IBATIS the .xml files IBATIS needs soon become a PITA, if you use Seam and plain JDBC, the very powerful (but very easy to make mistakes with) JDBC soon makes your software unstable. In my experience the best approach (other than using JPA, but sometimes you just can not) is to integrate Seam with SpringJDBC.