TopLink vs Hibernate... revisited... again :)

Would it be possible to get a Toplink versus Hibernate (or other ORM frameworks) going here?
It seems like the explosive adoption of Hibernate and the associated popularity contest in the industry has put some of us in a position where we're constantly trying to sell the-right-tool-for-the-right-job which, at least for me, seems to disqualify hibernate a lot of times, esp when scalable persistence is a requirement. It seems to be really difficult to convince folks that the popularity of hibernate doesnt mean it's by default the right option.
I've seen at least two threads on theserverside.com about hibernate versus cayenne, and despite the amount of noise in the threads, there were a few folks making some decent points. The TopLink folks were very quiet on the threads, but I know they were reading :)
So, anyone out there have any experience comparing TopLink and Hibernate? What do you all see as the shortcomings of each, esp from a technical architecture standpoint? Are GUI tools as overrated as Gavin claims? Where's annotation support for TopLink? Is TopLink overpriced? Is Hibernate's multi-tier non-integrated caching biting anyone on big projects where persistence needs to scale, or is integrated caching overrated? Is Hibernate3 really going to fix shortcomings that TopLink already addresses in current releases? What do you all think the Hibernate crew is doing right that the TopLink crew is doing wrong and vice versa? I'm not assuming any of these questions even merit answer but just interested in some objective discussion in a forum where TopLink guys might have a stronger voice.
Take care!

Well, I've only got a few minutes, but I could go on for hours.
I'll start by saying that I've been doing ORM for longer than many people knew that you could. I had been a previous TOPLink user but went for about two years without having to do any ORM.
Then, last year I started a new project for a client who insisted we use SqlServer and was hesitant to pay for any software unless it was absolutely necessary. (This is common these days, as the fact that there is so much free software out there encourages folks to try out the free stuff before paying for something that may or may not be better). Comparing the feature list of Hibernate to TOPLink and doing a little checking seemed to indicate that going with Hibernate would be a perfectly reasonable thing to do.
I will state, uncategorically, that this was the worst technical decision I have ever made in my life... twenty-plus years of Software Application Developing, most of it with object-oriented languages (Smalltalk and Java).
NOTE: I must couch that statement with the caveat that part of this was due to my naivete about the architectural assumptions I made about Hibernate before including it in my application. If I would have merely learned about Hibernate's architectural assumptions (though this was not easy due to their poor documentation) and allowed these assumptions to drive my development, it would not have been nearly as painful, just yucky. Also, if my objects were much simpler/flatter and I didn't need caching to speed things up, Hibernate could have worked just fine out of the box. Problem is, I had a complex system, needed caching, and Hibernate gave me nightmares as I tried to navigate through it.
As a test-first developer, I don't care about the GUI tools, as I'm happy to write tests to verify I can store and retrieve objects, then write the mappings and find out if it passes. What I would like is the ability to allow two threads to read the same object and not have to bring two copies of the object into memory or read the database twice. Call me crazy, but it just seems like object identity is a useful thing... perhaps my twenty years of developing object-oriented software has skewed my reasoning and I need to think like folks who haven't been programming as long.
Hibernate's poor documentation did make it clear that it did not want me to think this way, but it also suggested that, if I wanted to think this way, it could cache objects for me so it wouldn't hit the database twice. And, I'm sure it could have cached objects in some form, but not the form I wanted. Though I thought I followed the instructions on how to set up my cache, I found that reading the same object twice didn't always get the same (as in "==") object back.
To try to figure out why not (or why other things that an experienced object-oriented software developer couldn't figure out by reading the documentation), I had to dive into the code. This felt like diving into a water source in hopes of finding some gems, but discovering that I was swimming in a sewer full of, well, stuff that you'd find in a sewer.
Although Hibernate advertises itself as a framework, it is much more of a blackbox framework than a whitebox. Most of the methods and many of the classes are private or protected final. There are very few places to extend what's there. And there are virtually none that allow you to override their architectural assumptions.
The biggest architectural assumption I found to be problematic was that application developers can't be trusted to know which objects they intended to read and which they intended to write. Therefore, Hibernate "protects" you from having two sessions refer to (that's right, refer to, not modify) a collection of objects.
In the end, we ended up having to open up the source code and make some modifications in order to make our application run with reasonable performance. We had a lot of fairly deep objects (objects that contained objects that contained objects...) and the idea of not caching the ones that were not being modified across sessions just didn't cut it for us.
Additionally, we've spent the last few months supporting the app that we finally got into production, and greater than 75% of our bug fixing time has been due to the fact that Hibernate actually reads in objects from several places and it is difficult to tap into THE place an object is read in... because there isn't one. It goes through all sorts of intermediate states and we found out that having one process that is reading objects while another is trying to write the same object can cause some unfortunate side effects, even if you put synchronization locks in the obvious places.
We ended up with many person months of effort and a lot of special classes getting Hibernate to do what we wanted it to do, and had to open the source code (which will make it hard to ever upgrade to the next version).
Just recently we started a new project (where Oracle was the corporate standard DB) and decided we'd try to use TOPLink. Having not used it for several years, I had hoped it was going to be much cleaner than Hibernate to hook into our persistence layer. It was a piece of cake. In a few days we were doing what took us months to do with Hibernate, and we didn't have to perform any unnatural acts to get there.
I would recommend Hibernate to anyone who didn't know how to build a reasonably factored object-oriented system and didn't mind forcing their system architecture to fit Hibernate's architectural assumptions. But, if you think you might have reason to define your own architecture or modify Hibernate's default behavior, TOPLink is well worth the licensing fees. Not to mention the cost of your sanity.
Is Hibernate really free? Only if you don't value your time. I also found that you can buy outrageously priced support from JBoss to make up for their poor documentation on their poorly architected ORM blackbox framework. The documentation for TOPLink is far superior, and the simplicity of doing simple customizations and tweaks is like night and day.

Similar Messages

  • JPA: Toplink vs Hibernate

    I am using netbeans 5.5 and I want to use JPA. I am in favor of hibernate, but why does the netbeans has toplink being the default persistence library of JPA? What are the difference between toplink and hibernate if I'll be using JPA?
    By the way, I've seen an article "Using JPA in tomcat" and I would really like to use JPA in tomcat as I think it is much faster and lighter than Glassfish. But the article also uses toplink as the persistence library? Could someone guide me in using hibernate?

    This is an video from NetBeans site. Take a look.
    It will open your eyes about Hibernate and TopLink and JPA after you checking the codes that will be generated on your own system application.
    http://www.netbeans.org/download/flash/netbeans_6_gui_builder/netbeans_6_gui_builder.html

  • Toplink vs hibernate

    hi
    who can i determine which technology is better to use with oracle. Toplink or hybernate
    mostly we use hybernate but I want to know why toplink is better than hybernate
    thanks
    Message was edited by:
    Doug Clarke

    One of the key differences between TopLink and Hibernate is the caching implementation. TopLink provides an object cache where instances can be shared across the application, client, or transaction controlled by mapping metadata and application usage. The benefits of the shared cache are clear where read-only and read-mostly objects can be shared to avoid creating many copies of the objects unnecessarily (performance costs and extra garbage creation).
    If you have more volatile or data types that are not shared you can configure TopLink's caching to be isolated and therefore only cache the objects per client or transaction.
    If you have use cases where you need to ensure you get a transactionally isolated instance of an object you have configured to be held in the shared cache you can access the object within a UnitOfWork. This will make a read-repeatable copy of the object within the 'transaction' that will not be changed by concurrent writes from other committing UnitOfWork.
    Ultimately we work hard to offer TopLink/EclipseLink developers a solution with configurable and flexible options to address a wide variety of requirements. Understanding and leveraging our cache is a key success factor in any application development with TopLink.
    As far as the duplicate SQL comment goes I have reviewed the support request we recently received on this and the issue appears to be that if you change the existence-checking from its default of check-cache to check-database we have a bug where we incorrectly check the database for each registered new instance with a zero PK value. When we see an object with a zero primary key and sequencing configured it should be assumed to be new without requiring the select. We are working with support to get this issue addressed.
    Doug

  • Demo Application to Compare Toplink, JDBC, Hibernate

    Hi
    I Need a Demo Application which is implemented Using Toplink, JDBC, Hibernate to compare the overhead of using Toplink, Hibernate to Using JDBC.
    I got a link to Spring PetClinic Demo which is Implemented using Toplink, JDBC, Hibernate from Google but the spring site has removed this application.
    Please help to get this application or some other demo Application which can be used
    Excuse me for my bad english
    Thanks,
    Raghavendra

    PeClinic Demo Application is included in the Spring Frame work Dowload

  • Can I implement the ORM task without TopLink and Hibernate?

    Can I implement the ORM (Objest/Relational Mapping) task without TopLink and Hibernate tools?

    Any opinions are welcome.

  • Toplink vs. hibernate getReference implementation

    Hello,
    hibernate implement EntityManager getReference() to save you a database roundtrip if you do nothing but create an association, with the proxied instance in managed state.
    How toplink implement EntityManager getReference() ?
    Regards

    Note that the only time that returning a "hollow" entity from getReference() will even make any difference is when all three of the following are true:
    a) you are setting a unidirectional 1-1 or m-1
    b) you already know a priori the identifier of the target entity
    c) you have not loaded it recently or plan on loading it any time soon

  • Article comparing TopLink and Hibernate

    I recently had a chance to develop two very similar J2EE applications. In one application I used TopLink. In the other application I used the open-source Hibernate persistence framework.
    I wrote a brief high-level article documenting my experiences. The URL is:
    http://www.calextech.com/articles/HibernateToplink.pdf
    I'd appreciate any comments.

    Hello, I was wondering if you have any idea on how to use JDeveloper IDE effectively while working with HIBERNATE.
    Or is the notion that most of the 'HIBERNATE stuff', like generating mapping files, etc are well done outside the scope of the IDE.
    We are currently evaluating HIBERNATE, and will really appreciate your help in this regard.

  • TopLink versus Hibernate?

    Hello, everyone:
    We're in the midst of deciding between Hibernate (which we
    currently use) and TopLink (which looks very good).
    I've checked Google, but I did not find a great deal of
    useful information. Can anyone point me to a good link?
    Thanks!
    Regards,
    Oswald

    Hello, everyone:
    We're in the midst of deciding between Hibernate (which we
    currently use) and TopLink (which looks very good).
    I've checked Google, but I did not find a great deal of
    useful information. Can anyone point me to a good link?
    Thanks!
    Regards,
    Oswald

  • Safari broken revisited again

    Been gone a while, back now...
    And, I still can't get Safari 3.2.3 to work - I can't quit (sometimes); I get the spinning beach ball and can't get beyond http://www in status bar (sometimes). I've poked around here and it seems I am not the only one with this problem.
    I had given up on Safari but old habits die hard and I accidently clicked on its icon on the dock only to have the problems recur.
    I am successfully using both Firefox and Camino with no issues. I love the control I have over cookies with them both, something "Safari Plus" gave me with v.3x (thanks, Klaus!), but which I understand has no equivalent in v4.
    Just wondering, since 3.2.1 stopped working and I followed everyone's instructions to make it work to no avail, and then went to 3.2.3 and that didn't work either, is there ANY reason to try 4x? or do I just kiss Safari good bye? (ie is there any reason that I have to have Safari?)
    Mrs H

    ~Bee wrote:
    Mrs H.
    Hello again . . .
    So sorry to hear of your recent problems.
    As to the Kernel Panic screen (grey screen with restart warning),
    If there's anything attached to you Mac with a cable, unplug it.
    Other than an Apple Keyboard and Mouse.
    Then see how things go from there . . .
    Which Mac is it, by the way???
    Thanks for your concern ~Bee.
    I asked a question about the start up problem in the G4 thread
    http://discussions.apple.com/thread.jspa?threadID=2097097&tstart=0
    I just referred to it here.
    It's not a "Kernel Panic screen (grey screen with restart warning)," problem - I think! The chime doesn't chime, but everything else works fine at startup. No warnings, no grey blank screens...
    " If there's anything attached to you Mac with a cable, unplug it. Other than an Apple Keyboard and Mouse. " All that's attached with USB, (besides keyboard which is attached to display) and my mouse is a UPS power supply, and my LaCie HD which is my startup drive - don't ask - that's just the way my system was reconfigured for me by the Apple store when I wanted to move up to Tiger - OS 9 runs on my internal HD and OSX is on the LaCie.
    I'll disconnect the UPS and try again tomorrow. I'm scared to try tonight.
    If we are going to discuss this issue further, could we do it at the place where I asked about it - the link above, so I don't get people upset for posting the same thing in 2 places.
    Thanks again for your concern.
    Mrs H

  • Create PDF Compatible File Revisited AGAIN for PC

    Hi all,
    I know my way around a Mac, but I would like to help a PC buddy of mine out, too to achieve the same thing—that is, changing the code in the Illustrator preferences file so that every time you save you don't automatically save a PDF compatible file.
    Can anyone help me find my way through the directories for the Preferences file on a PC?
    Thanks
    Re: Create PDF Compatible File Revisited
    Sorry,  I was thinking of the New Document Profiles. Try  Users>(yourname)>Library>Preferences>Adobe Illustrator CS4  Settings.

    see this thread http://forums.adobe.com/thread/655678?tstart=0 (number 6)

  • ABC Analysis (revisited again!!!)

    Hello Friends,
    I saw few posts on how to do ABC analysis, but there were no concrete answers.
    To summarize the requiement (say based on Good Receipt Quantities):
    1. Top 25 -> indicate as 'A'
    2. Bottom 25 -> indicate as 'C'
    3. Records between 25 to 75. -> indicate as 'B'.
    SAP How to paper(How to.. Realize an ABC Analysis) is on counts and not on cummulative %.
    I used CKF, but it is only for display.
    I used conditions, but it does not give the middle B records.
    The last option would be VB macro, but then this would be not be a fantastic solution, as SAP Query can do ABC analysis, but BW Query would not be able to!!!
    Regards
    Pranay Dave

    Hi,
    For example :
    Classified Object (= a Characteristic)= clients
    Classification Criterion (= a Key Figure)= revenues
    You want "20% classes" (five)
    The ABC analysis ranks the records from the bigger value to the lower value of the Classification Criterion.
    - If you want the APD to classify as a "TOP N" of your Classified Object, you will have to choose the "Cumulated Percentage of Classified Object" while building your ABC model.
    ==> It will give you a classification that answers    to "who are the 20% of my clients that gave me the best revenues?".
    - If you want the APD to classify your Classified Object regarding the percentage of the Classification Criterion, you will have to choose the "Cumulated Percentage of Classification Criterion"
    ==> It will give you a classification that answers to "who are the clients that gave me 20% of my revenues?".
    I hope it helps...

  • Link Aggregation, revisited again

    I did all this research to find out how LACP Link Aggregation actually functions in OS X Server, and found many varying opinions out there (there is precious little in OS X documentation, it says essentially set it up and you are good to go:). It seems there is a disagreement on whether OS X (properly configured with LACP switch) will actually spread out traffic dynamically, or whether it only spreads out traffic when one becomes saturated.
    So I did a test, configured en0 and en1 as a link aggregate called Fat Pipe, and both show green (Cisco switch with LACP for those ports). However, no matter how many concurrent read/writes to different servers, I can't confirm that there is any improvement at all, which leads me to believe that 'true' load balancing is not happening.
    Also, I have read 2 differing opinions on how the bonded NICs should appear in Network prefs: configured as "Off", or as DHCP with self-assigned 169.x.x.x address.
    Anyone with info, would be much appreciated. At this point I'm almost inclined to just give each NIC their own IP, and just manually assign some users to connect with one IP, and some with the other...doesn't seem as efficient as aggregation though.
    Thanks

    I did all this research to find out how LACP Link Aggregation actually functions in OS X Server, and found many varying opinions out there
    There's no disagreement as far as I'm aware
    It's a function of link aggregation (which is an IEEE standard) and therefore not subject to the whims of Apple's implementation.
    The low-down is that the links are both used and specifically which link is used is based on the MAC address of the source and destination hosts.
    Moreover, there is no concept of link saturation or failover when one is full - it's entirely possible for one to to be saturated and all the other links to be completely idle if that's the way the MAC addresses run.
    A simplified view of the algorithm makes it easy to understand - for a 2-link trunk using en0 and en1, the system looks at the MAC addresses of the source and destination hosts. If they're both odd it uses en0, if they're both even, it uses en0, if they're different (one is odd and one is even) then it uses en1. Therefore, it's entirely possible that all traffic will use one link if all the MAC addresses are odd (or even).
    The upshot is that you will never exceed the single link speed (e.g. 1gbps if using 1gbps links) to any single host on the network, so the transfer rates between two devices will be capped at that. However, if a second host initiates a connection, and if that second host's MAC address causes its traffic to transmit over the other link, the the second host's transfers won't be impacted by the first host's transfer.
    I can't confirm that there is any improvement at all, which leads me to believe that 'true' load balancing is not happening.
    In the real world, it's unlikely that you'll get a single host pumping 1gbps of traffic into the network, so you only really see the effect when you have multiple hosts all talking at the same time. A reasonable test would be to time simultaneous transfers to/from the server, then pull one of the links and see if things slow down.
    Also, I have read 2 differing opinions on how the bonded NICs should appear in Network prefs: configured as "Off", or as DHCP with self-assigned 169.x.x.x address.
    The links don't appear at all in any of my servers running with trunks. The only interface I see is the trunk.
    If I use ifconfig in the terminal I see the underlying links as 'active', but they don't have any IP address assigned to them.

  • "Password rejected" revisited - again

    Greetings. I have been getting the "password rejected" alert when trying to receive from a web-based POP3 email account "macmail.com" for a couple of weeks. (OS X 10.3.9; Apple Mail 1.3.1. SBC Yahoo! DSL is my ISP.) I have also tried several other email clients (CE QuickMail. GNUMail. Entourage). They all also reject my password. I can access my mail at www.macmail.com, or through www.mail2web.com.
    I did a quick "telnet" session in Terminal this morning. Here are the results (with personal info x'ed out):
    Last login: Fri Jan 6 20:41:11 on console
    Welcome to Darwin!
    [Macintosh:~] (shortusername)% telnet mailin.macmail.com 110
    Trying 62.189.250.22...
    Connected to neptune.silverserve.com.
    Escape character is '^]'.
    +OK <[email protected]>
    USER xxxxxx
    +OK
    PASS xxxxxx
    could not create lastauth table CREATE TABLE vlog ( id BIGINT PRIMARY KEY AUTO_INCREMENT, user VARCHAR(200), passwd VARCHAR(100), domain VARCHAR(200), logon VARCHAR(200), remoteip VARCHAR(100), message VARCHAR(255), timestamp TIMESTAMP(14), error INT, INDEX user_idx (user), INDEX domain_idx (domain), INDEX remoteip_idx (remoteip), INDEX error_idx (error), INDEX message_idx (message) )
    error inserting into lastauth table
    +OK
    Can anyone tell me what is happening?
    The real kicker to all of this is that GyazMail WILL!!! retrieve my email from "macmail.com" without even breathing hard, and with an identical setup as all of the other email clients. Also, my "sbcglobal" POP accounts work fine. I sent an email to the folks at macmail.com, but have received no response.

    Baron,
    GyazMail gave up the ghost this morning. I emailed Goichi Hirakawa to see if he could make sense of the problem, He suggested holding down "Shift-Option" while I clicked the Send-Receive button, which would generate a Console log to compare with the telnet session log. As soon as I did that, I got the same "ERR Authorization failed" message that every other email client I've tried produces; and I cannot find a Console log either. The condition persists even after a complete uninstall-reinstall. Oh well. I guess I'll just have to use the web-based MacMail interface to retrieve my MacMail. (Have you seen this site? - http://www.mail2web.com/ )
    I think MacMail is maintained by "robots". I've gotten no response from them at all. I think I too may let those addresses lapse. Fortunately, I don't have too many important contacts at Macmail.
    Edit 10 minutes later: see also http://www.emailaddresses.com/email_pop.htm
    Message was edited by: jtcluck

  • Hibernate's dual-layer cach and TopLink's caching strategy

    Dear members,
    I understand that caching between hibernate and toplink is implemented (or utilized) differently. Hibernate seems to have 'dual-layer caching' (which may imply they have two layers of cache) whereas TopLink has session cache and shared cache. The way I see it, they seem to be aiming for the same thing. Are there any differences between (obviously there are, only that I do not know them) those two caching architectures, and how different are they?
    Howard

    Yes there are differences :) For details check out
    TopLink vs Hibernate... revisited... again :)
    and
    Indirection - how are references resolved after session has been closed?

  • Lazy loading differences Toplink vs. Hibernate - plz. explain

    I'm in the process of evaluating both Toplink and hibernate as potential ORM framework to use for a project I'm currently involved in.
    My question is about how Toplink resolves lazily loaded associations. In hibernate I have to perform a query inside a transactional context boundary, like:
    Session s = SessionFactory.getSession();
    s.beginTransaction();
    ... your query logic here
    s.getTransaction().commit();When the query involves associations which are declared as lazily loadable, trying to invoke these associations after the transaction boundary has been closed, results in an exception. This differs from Toplink (my JUnit testcase breaks for Hibernate if I set the DAOFactory to return hibernate enabled DAO's) and I'm wondering why?
    I'm guessing this has something to do with how Toplink manages its clientsession, but would like to get some confirmation about this. It looks like as-long as the thread of execution is running I can resolve associations using Toplink, but not when I use Hibernate.
    This brings me to yet another question - what's considered best practices in Toplink regarding session disposal. Should I do something myself, or let the garbage collector take care of it?

    I'm not too sure here, but I think it's because TopLink has a "long running" ServerSession. When you do lazy initialization outside a clientsession it is for read only purposes and it will use the centrally managed ServerSession (and cache). I'm still trying to figure out the exact relationships here, som I'm not too sure. :) Hibernate does not have a centrally shared cache, and will not be able to instantiate objects if the session is closed (for each session, objects are instantiated from it's data cache).
    As for handling resources and closing/opening, use the Spring/TopLink integration. It will handle it for you and give you heaps of convenience methods that uses some clever tricks to decide if it should fetch objects with Session or UnitOfWork. It will also do some good Exception handling built into Spring.

Maybe you are looking for

  • How to remove the default icons from the toolbar of modal dialog box screen

    Hello Friends, Iam calling a screen from function module using CALL SCREEN statement. The screen is of type Modal Dialog Box. I created some input fields and buttons in the screen. When the screen is displayed, I can see the tool bar at the bottom al

  • Can't get Login Manager (xdm) to work

    I would like to boot directly into a login maqnager such as xdm or wdm.  I have read the wiki on "Adding a login manager" but can't get xdm to work. I have the following line in my /etc/inittab x:5:respawn:/usr/bin/xdm  -nodaemon I have the following

  • Save Document on Network Location

    Hi all, I am working on a plugin application, in that saving Image files on a specific location by using JSX file. I have done with that but it works only with local drive. When i try to save that file on any Remote Machine it gives following error:

  • Storage bin issue -

    hi friends storage bin 01-01-01 stock is 1000 quantity...After PO-GRN all stock is updated in same storage bin  01-01-01... my querys is i want to fill 100 qty should be filled in 01-01-01 storage bin , if quantity excess means remaining quantity sho

  • After inventory transfer why we post excise document ?

    Hi all Dear friends I have a small doubt ....after posting the inventory transfer for excisable goods from one WH to another WH the system asking to post respective Excise invoice ....... why we post the excise incoming or out going invoice (by selec