Home

News: The Java persistence ghetto (and how jOOQ might change that)

  1. We like to offer different opinions at MarcoBehler, and the first one is this: A huge part of the Java community has been living in a ghetto and/or cult and/or comfort zone when it comes to saving their objects to a database. Take for example these phenomena you see over and over again in real life projects:

    First, does not matter how much he abuses his database as a stupid data dump and that he ignores those generated 60 table-join sql statements because he never looks at them in the first place, the fashist Java developer needs a structure to be happy:

    Read More


    Threaded Messages (10)

  2. JPA is difficult but complete. It has a learning curve, and you'll have surprises if you try to shortcut its complexities. But they mostly are there for a reason. Difficult stuff is difficult using JPA, that's true.

    JOOQ is quick to learn. And is proprietary stuff. Not free. Only one implementation. No public review, only one body involved in its evolution. SQL-oriented, not OO (ok, they say it's a feature).
    As a serious professional, learn JPA. Fully. There is no excuse for not knowing which sql queries are generated in your production app. Replacing it with a more basic framework is no solution.

    BTW, you lost me at the "fashist" part (and please look the concept up). 

  3. Do YOU create free software?[ Go to top ]

    Interesting thoughts...

    Software not being free. Is YOUR software free and "not proprietary"? If so, how do you finance it? How do you earn a living? And why are you doing it?

    Only one implementation. How many people actually do use alternatives to Hibernate and why? Because they used to use TopLink for the last 20 years and the learning curve to switch to Hibernate is too high?

    No public review. Who exactly is "public", and what are their main interests? (Do note that a major driving force for the JDK is Credit Suisse, for instance. What is your stake and relation with Credit Suisse?)

    Only one body involved in its evolution. Do you say that to YOUR customers also, about your own software?

    SQL-oriented - and then "as a serious professional". What's not serious about SQL? In fact, SQL is reviewed by more entities than the JLS, let alone the JPA specs. Have you ever thought about that?

    More basic. Fair enough. But don't forget: You probably replaced your sophisticated EJB 2.0 framework by a more basic one, which was (at the time) proprietary, had only one implementation, had no public review, nor multiple bodies involved in its evolution. It was called Hibernate, prior to JPA.

    Oh, and if JPA has to be learned fully, then I challenge you to also FULLY learn SQL, including all the SQL:2011 clauses, regardless of whether they're part of your specific implementation. Because as a serious professional, you shall fully learn SQL. And while you're at that, learn also everything about execution plans, and join, fetch, buffer caching, cursor caching and all other sorts of algorithms. Because there is no excuse for not knowing which SQL transformations are generated by your database's CBO.

    (oh, and I sincerely hope you're neither a Windows, nor a Mac user, because that wouldn't be free, and there is only one implementation of each OS, and no public review, and only one body involved in their evolutions.)

  4. Do YOU create free software?[ Go to top ]

    Wow, Lukas has already blogged about that reply!  Based on the fact that you're posting on the jooq blog, I think your opinion may not be terribly objective.

    http://blog.jooq.org/author/lukaseder/

    That being said, I doubt the OP really cares of jooq is free or not. He does raise some valid points (pretty much all of them).

    Comparing a custom solution for a customer to a framework that is targeted at the masses seems like comparing apples and oranges to me.

    If a client asked me to write a very specific application for them, I would certainly charge them.  If I dreamed up a new ORM and wanted people to use it, why would I assume it's worth anything to anybody?

    The OP didn't come to you and ask you to develop a brand new ORM for him.  For his purposes (and most folks in the Java community), JPA and Hibernate are more than good enough.  Buying into a paid framework would be a risk for many.  Forget all the (perfectly valid) points the OP listed, what if the price goes up some day?  What if jooq gets sold?  What if a company buys jooq simply to kill it, since it competes with something they already have?

    Btw, where I work, we do indeed pay for Hibernate and Spring support.  The framework is free, professional support is not.  The fact that we barely use the support is beside the point (management gets a warm and fuzzy feeling knowing there is paid support for our tools and is willing to pay for that).

    JOOQ may be fantasic.  If you want to charge for it, that's fine.  However, please don't get upset when others think JPA is "good enough", and please don't compare a custom solution made for a client to a general purpose framework in terms of getting paid for your work!

    Andrew

     

  5. Do YOU create free software?[ Go to top ]

    Thanks for your response, Andrew. Yes, my opinion isn't objective in this regards, but no one really has an "objective" opinion. Let's not delve into such a meta-discussion, though.

    Absolutely, jOOQ is proprietary software released under two licenses, one of which being ASL 2.0, for you to fork and continue to use right now in whatever way you want. Irrevocably, perpetually. While you seemingly cannot resist to refer to your management's warm and fuzzy feeling with a bit of cynicism, you do not seem to question any of the business model behind Hibernate, Spring, etc. Because what you get most importantly with Hibernate is free beer (with no strings attached).

    Our commercial license is also quite permissive for our customers. They can buy perpetual licenses with the right to maintenance in cases where we as a vendor cannot -for any reason- supply support and warranty, including if someone buys us.

    But we're neither VMWare, Pivotal, nor Red Hat, who are able to sustain a business model merely based on support from customers with managements large enough to pay thousands of dollars for a "warm and fuzzy feeling". So we chose dual-licensing.

    If you have a closer look at jOOQ and the traction we're getting, you may also appreciate that we're not implementing a database abstraction just for one customer. This is a general-purpose internal domain-specific language to model *all* SQL, useful for many customers. As that, comparing it with JPA is really comparing apples and oranges as well. JPA is about object persistence. jOOQ is about SQL. To be fair, you could compare it with JDBC or Spring's JdbcTemplate.

  6. Do YOU create free software?[ Go to top ]

    Software not being free. Is YOUR software free and "not proprietary"? If so, how do you finance it? How do you earn a living? And why are you doing it?

    Some is proprietary, some is open source. The service never is free. New features development is paid for by customers, even for open source stuff.

    But I insist in using free software when possible. And I wont select a commercial alternative if there aren't strong reasons for it.

    Also, I really believe in the power of Java EE specs. I wouldn't choose Java, which isn't the best language, if it didn't come with all of this: JSRs, RI, often multiple implementations, strong community, etc. I'm not just talking about the free stuff that you'll randomly find on the internet (and I count Spring in that), that isn't part of Java EE. I'm talking about the standardization process. The fact that there is a standard way of writing 90% of most applications, whatever the specific implementation is.

    Only one implementation. How many people actually do use alternatives to Hibernate and why? Because they used to use TopLink for the last 20 years and the learning curve to switch to Hibernate is too high?

    For the 5 last years or so, I didn't see anything but JPA. No Hibernate or Toplink specific stuff, or marginally. In fact, I only saw Hibernate a few times as an implementation, my last clients being with Eclipselink/OpenJPA. Lastly, I did a quite complex JPA POC on Glassfish/Eclipselink, that I later ran on Websphere/OpenJPA without problems.

    You make it sound exceptional and difficult. It really isn't.

    No public review. Who exactly is "public", and what are their main interests? (Do note that a major driving force for the JDK is Credit Suisse, for instance. What is your stake and relation with Credit Suisse?)

    I've never been involved in the JDK, but I did give my opinion more than once for Java EE specs (JPA, JSF, EJB). Quite easy to do, the simplest but non-unique way being specification mailing lists, implementation development discussions, etc.

    Only one body involved in its evolution. Do you say that to YOUR customers also, about your own software?

    Whenever some big amount of work has been done, definitely. There is always at least one backup plan.

    Anyway, this is not about my customers, but about yours ;-) I understand that you make it sound better than it is, but you'll understand that I don't :-D

    SQL-oriented - and then "as a serious professional". What's not serious about SQL? In fact, SQL is reviewed by more entities than the JLS, let alone the JPA specs. Have you ever thought about that?

    Sure, but the spec isn't even as strong. Just look at the differences between db vendors, how Oracle judges that it can violate 'details' (empty string is null, anyone?), etc.

    I'm not underestimating SQL importance, but I strongly believe that there should be some abstraction from SQL in any serious application, whether OO or anything else.

    More basic. Fair enough. But don't forget: You probably replaced your sophisticated EJB 2.0 framework by a more basic one, which was (at the time) proprietary, had only one implementation, had no public review, nor multiple bodies involved in its evolution. It was called Hibernate, prior to JPA.

    It wasn't hibernate in my case, but anyway. Then came some evolution. It was long ago and I'm not going back.

    Oh, and if JPA has to be learned fully, then I challenge you to also FULLY learn SQL, including all the SQL:2011 clauses, regardless of whether they're part of your specific implementation. Because as a serious professional, you shall fully learn SQL. And while you're at that, learn also everything about execution plans, and join, fetch, buffer caching, cursor caching and all other sorts of algorithms. Because there is no excuse for not knowing which SQL transformations are generated by your database's CBO.

    I'm constantly learning, and am aware of a great deal of that. Still, if I write bugs by ignorance of SQL standards, I won't have any excuse for that. 

    (oh, and I sincerely hope you're neither a Windows, nor a Mac user, because that wouldn't be free, and there is only one implementation of each OS, and no public review, and only one body involved in their evolutions.)

    I do run Windows, mostly because of Office than anything else. I'll welcome any serious alternative that doesn't look like it's 1992, but that's another stoy.

    Anyway, I don't have any dependency on it. All my code builds and runs on linux on all my client infrastructure.

    As a conclusion, I'd say that I don't even understand why someone would choose JOOQ over JPA. Why would you pay for something that's non-standard/proprietary when the alternative is free.

    There is room from improvement in JPA. Why don't you just try some suggestion on the spec mailing list? 

  7. Do YOU create free software?[ Go to top ]

    Rather than replying to me, the OP wrote a whole article to speak out its frustrations: http://java.dzone.com/articles/free-standard-open-software#comment-116695

    Agresive marketing, anyone?

  8. Do YOU create free software?[ Go to top ]

    frustrations

    No frustrations here, don't worry

    Agresive marketing, anyone?

    Nope, just evangelism for the beliefs behind jOOQ. Which are:

    • Think out of the box
    • Embrace SQL

    I just happened to disagree with your points, which are just as evangelist for the sake of Java EE. I hope you do realise the evangelism in your own claims?

  9. Do YOU create free software?[ Go to top ]

    Hi Yannick,

    Thanks for your interesting reply. I can see that from your experience, the Java EE way is the way to go for a lot of your projects. I have a different background - one that is much closer to SQL and to applications that closely couple with SQL. Your putting object-orientation in the middle of the universe is as dogmatic and subjective as my putting the relational model and / or functional data transformation in the middle of everything. I understand that we have different opinions based on these pre-conditions, which doesn't make either one of us more right or wrong in general.

    I'm not saying (or endorsing Marco, the original author's, opinion) that jOOQ should be a replacement for JPA. In most cases, just jumping ship and choosing the next best framework is not a very good idea. Maybe it wasn't a good idea to start this discussion based on the aforementioned article.

    But there is a world where SQL really matters, and Java EE has not embraced that world in the least bit during the last 15 years or so - interestingly, though, as Oracle makes much more money with that world than with the Java EE one. In fact, not even JDBC takes into account the latest evolutions in the database market, both as far as ISO / IEC standards and vendor-specific extensions are concerned. This is a bit frightening, but also very challenging and interesting, as we believe to fill this gap with jOOQ.

    So, from our perspective (and I would believe also from Gavin King's), there are some aspects of database interaction that simply cannot be solved with Java EE only. You will need to resort to SQL. Now, if you insist on using (Java) standards, then you're going to be stuck with JDBC. We're offering a brighter option to that. And it is free and Open Source under the terms of ASL, if you're also using a free and Open Source database.

    And no, currently we have no plans of getting involved with the JPA expert group. :-) Our API is definitely not a good match for JPA's annotation-based visions.

  10. Do YOU create free software?[ Go to top ]

    Hi Lukas,

    Cool to see a more nuanced picture.

    I even have to say that I agree with you up to some point.

    Even if I avoid SQL as much as I can (in Java), I agree that it could have it's place. I never code most db operations in SQL in a Java application, but there are some use cases where it is needed. I'm thinking of db migrations between applications, for example, where it's mostly unavoidable (liquibase, flyway, ...). I guess there are, as you said, other use cases. JDBC is lacking features, that's right and I thus fully agree with this, even if it hasn't impacted me for years.

    I know understand why you're saying that JOOQ isn't an alternative to JPA, and so that you can't just propose JPA improvements. What I still don't understand is why the JOOQ team doesn't propose a JSR to fill the gaps. Is it some kind of protectionism, or are there other reasons?

    Yannick

  11. Ghetto[ Go to top ]

    Look that word up also. Members of a minority group do persistence with JPA? When will people stop using rhetoric in a headline in a desperate attempt to get a headline and attract attention?