Announcement Announcement Module
Collapse
No announcement yet.
How to define the boundaries between hibernate and spring? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to define the boundaries between hibernate and spring?

    Hello,

    I am wonder how could I define the limits for what I have to treat in the Hibernate side and what is in the Spring side, when both have the same features, for example, to transactions control?

    I know that decreasing strictness comes increasing performance, but where I have to define it, in Hibernate or Spring? For this particular situation, I'm pretty much to believe that using the Spring strategy should be better, because I see as more powerful, but I really would like to have more arguments for that.

    I also know that I can read the books and decide by myself (actually is what I have done), but if you have any answer that could help me to go faster to what I really need to know, I would thank you so much.

    Best Regards.
    Last edited by DistillingSpring; Oct 26th, 2006, 05:00 AM. Reason: bad english

  • #2
    If you want declarative transactions you have to use Spring. If you want programmatic transactions use can use either. Note also that Spring transactions allow you to mix pure JDBC with Hibernate in one transaction transparently.

    Comment


    • #3
      Thank you very much for your reply. I will take a better look in the declarative transactions in Spring. Is there any other point should I consider between Spring and Hibernate? Regards.

      Comment


      • #4
        Well, the point to consider is that once you go Spring way, you will, most probably, not get any support from Hibernate as they seem to suffer from some kind of a Spring allergy.

        If you have no problems being on the bleeding edge I'd suggest using JPA and not pure Hibernate. There is a Hibernate JPA implementation, but you can theoretically switch to Toplink or something else, if you want to.

        Comment


        • #5
          I also have to see this Hibernate JPA. Being honest with you, I didn't know about this "allergy" from the hibernate people, since what really rocks nowadays is the combination Spring+Hibernate. In any case, I will take it into account. Thanks again.

          Comment


          • #6
            I would just like to back dejanp statements - no matter what ORM/persistence framework you are using, if you can code against the JPA do it. The standard is already used by the major ORMs (Hibernate/Toplink/OpenJPA) and the market keeps adapting to it. Being able to switch the persistence framework w/o having to change the application code is a big gain mainly for the end developer and you should take advantage of that.

            Comment


            • #7
              Thanks Colin to complement what dejanp have written. I still have to do my own researches, but could you do a brief what JPA is all about and why it's better to work against it? I am afraid that I wasn't following the latest news about it. Thank you again.

              Comment


              • #8
                This is not theServerSide, but it's an interesting article about Spring+JPA and also some issues raised by Gavin King:

                http://www.infoq.com/news/Spring-JPA...the-next-stack

                Regards.

                Comment


                • #9
                  Sorry, I just saw the comments from Calvin King. I don't have time now to do a better and technical comment, but for me this guy is just not that fair when he talks about Spring, even if he is a little genius (but it's out-of-topic).
                  Last edited by DistillingSpring; Oct 27th, 2006, 05:00 AM.

                  Comment


                  • #10
                    You can find 'JPA vs Hibernate' or 'why JPA' materials if you do some googling (which I think you already done). The Sun site as well as Toplink (which is JPA RI) should provide enough information.

                    P.S. you managed to misspell two names in the same thread; i.e. it's Costin not Colin and Gavin not Calvin.

                    Comment


                    • #11
                      Costin,

                      Sorry for the misspelling. My point when I sent this article is that they discussed that JPA might not be mature enough, if I understood well. What can you add on it?

                      Thanks.

                      Comment

                      Working...
                      X