cancel
Showing results for 
Search instead for 
Did you mean: 

Why iBatis?

akakunin
Champ in-the-making
Champ in-the-making
Hi friends!
really great to see new project and hope it expected great future.

I'm looking into activity, because I did not like in jBPM close relation to hibernate for persistence.
Really, in these days I was sure new projects use JPA by default for ORM (since JPA is standard) - and expected to see it in Activiti. For me it was one of the advantage comparing to jBPM, since allow closer integration into environment I'm going to use bpm engine.

But - I found Activiti used ibatis. are any big reason for it? Do you think it is hard to implement JPA persistence layer for Activiti (as part of contribution into project) or any other Persistence layer? As far as I understand - Activiti also supports (planned to support) nosql, so, looks like persistence layer are pluggable.

===
Alexey Kakunin
EmForge: Liferay Based project hosting services
27 REPLIES 27

jeff1
Champ in-the-making
Champ in-the-making
I wonder why ibatis, too

sebastian_s
Champ in-the-making
Champ in-the-making
It's just a guess but I think iBatis was chosen due to it being just a database abstraction layer but not a object-relational mapper as Hibernate is one for example. By using iBatis they achieve their goal keeping the engine sourcecode more independent of the underlying database abstracton layer implementation as well as having more control over the persistence functionality.

haison
Champ in-the-making
Champ in-the-making
From the ibatis page(http://ibatis.apache.org), we find that it has moved to google code serveral days before,just ike tom left jboss.So the same experience of their leader let the product together. Smiley Very Happy

jeff1
Champ in-the-making
Champ in-the-making
wow MyBATIS. I'm wondering what is going on behind this.
BTW, why iBATIS? maybe tom or joram could say something on this topic 🙂

tombaeyens
Champ in-the-making
Champ in-the-making
first we tried open jpa.  but the development cycle was pretty hard with the compile time weaving and stuff like that.

switching to ibatis gave us ease development.  but we also found that we had more control.  the downside is that you have to code a lot more then when you use hibernate or jpa.  we're still in evaluation mode, but so far so good.

akakunin
Champ in-the-making
Champ in-the-making
Tom, thank you for clarification.
Do you think it is possible (with reasonable effort) to write another, custom persistance layer for Activiti? How deep Activiti depends from ibatis?

jeff1
Champ in-the-making
Champ in-the-making
allow me to throw out my point first
maybe it's unnecessary to write a persistence layer for activiti, it's just OK if activiti can integrate with the mainstream persistence solution(jdbc/hibernate/jpa/xbatis/…) with the current mechanism, keep it simple.
for example, the host program and activiti can have consistent transaction whichever persistence way the host program is approached

bernd_ruecker
Champ in-the-making
Champ in-the-making
I discussed that issue with Tom via email already as well. So I will provide the stuff from there here as well:

– BERND
Hi Tom.

You wrote in your blog:

But I would be really interested to find out why you want to plug your own persistence provider. If it is for another storage then JDBC, then I can understand. But if we work with your JDBC connection and your persistence framework also translates to JDBC, does it matter what persistence framework we use internally?

Let me give a quick answer from my side, I see three reasons for JPA against iBatis:

1.) As we promote tu use standards (BPMN) it would be cool to do that where possible
2.) I saw a lot of companies / projects having clear rules which persistence frameworks are allowed. Not sure if that was only a problem with Hibernate, but with jBPM Hibernate was a showstopper for some projects
3.) And this is the most important: If you build big applications you have to know the nuts and bolts of the persistence framework, e.g. for caching, clustering, and so on. This is normally true for Hibernate, but I don’t know many projects or companies using iBatis. But for Hibernate I know excellent experts (and you need them sometimes ;-)).

On the pro side for sure the license is an argument. And it is already too late to change it I guess, so anyway. But just to have said I am not that happy with it as well…
– Tom's answer:
we first tried open jpa but it was too clumsy in development.  hibernate is good to work with but its LGPL so no go

switching to ibatis put a bit more burden on us, but it also has a benefit of more control.  hibernate is most of the times really good, but still it has these magical flushes.  fixing problems related to flushes can be very challenging with hibernate.  with ibatis you know what happens, when and how and you're in full control.

but is's not religious for us.  but we have to have good arguments.  currently i'm quite happy with ibatis.

> 1.) As we promote tu use standards (BPMN) it would be cool to do that where possible

(i agree with some of your argumentation, but it's just quicker if i play devil's advocate here)

JDBC is standard too.  using as much standards as possible in your persistence layering shouldn't be a goal 😉

> 2.) I saw a lot of companies / projects having clear rules which persistence frameworks are allowed. Not sure if that was only a problem with Hibernate, but with jBPM Hibernate was a showstopper for some projects

i don't see ibatis being a problem.  it's only JDBC that comes out.

> 3.) And this is the most important: If you build big applications you have to know the nuts and bolts of the persistence framework, e.g. for caching, clustering, and so on. This is normally true for Hibernate, but I don’t know many projects or companies using iBatis. But for Hibernate I know excellent experts (and you need them sometimes ;-)).

with ibatis you don't need those experts.  it's us in full control and the code is readable and predictable.

– BERND
Another argument, especially for an open source project: A lot of people are not familiar with ibatis.

– BERND
Today I had a discussion with an architect at a big company. He told me that currently no other persistence mechanism as Hibernate is deployed on the machines here, since they invested a lot of money to get that running correctly in a clustered environment, together with JMS, JTA etc…

Normally people ask for JPA, here Hibernate is fixed. So this could be a show stopper to run Activiti 😕
I will have a look into the code base to see how the persistence is pluggable (which I am sure it has to be for being Cloud deployable). It would be really good to have JPA ready in my opinion. Nobody really knows ibatis 😕

– TOM
i think we have to protect those type of architects against themselves 😉

in my jbpm 1 days, i'ld say of course it's pluggable already with the persistence session. 

but  the argument of their expertise in hibernate does not hold.  i can guarantee that they will be working with a debugger and asking for our help which we can't give them.  if they follow whatever persistence framework that we use, we will have done our clustering QA and they should not have to use a debugger.

why do they want to organize their architecture on the persistence framework, rather then JDBC.  that looks like a broken strategy to me.

when we switched from hibernate over  OpenJPA to EclipseLink we had very different errors.  and that is switching between *JPA* providers.  i don't see the point in spending our time on that.  and I think most people will underestimate the work.

although i'm very convinced that there is no valid argumentation for us to support multiple persistence providers, i think might still can consider it because embeddablility is in our core values.  and if 80% of developers consider persistence framework as part of the app environment that we have to embed into, then at least we should consider it.

but my current belief is that supporting multiple persistence implementations is 1) it's a waste of our time and 2) not feasible with the resources we have.

tombaeyens
Champ in-the-making
Champ in-the-making
Here's the summary of how I see the tradeoff:

on the one hand: "although i'm very convinced that there is no valid argumentation for us to support multiple persistence providers, i think might still can consider it because embeddablility is in our core values. and if 80% of developers consider persistence framework as part of the app environment that we have to embed into, then at least we should consider it."

on the other hand, supporting multiple persistence frameworks will be a very big challenge to get the QA set up.  it's not only just providing an implementation of the persistence session interface.  it's also figuring out how to deal with the differences between persistence providers without breaking the other providers. and imagine the build scripts for continuous integration when we want to test the matrix of {servers like tomcat versions, jboss, genronimo} x {transaction demarcation technologies like Spring, JDBC, JTA} x {persistence providers} x {databases like oracle, mysql, postgresql,…}

i think the work involved to support different persistence providers is underestimated big time.  and it's not adding any functional features. 

probably the point why i currently tip over to not supporting multiple DB persistence providers: i don't see the value.  i can  see that an architect thinks it's cooler that all of his application is build on the same persistence provider.  but i think that is only a small aspect compared to the bigger issue of QA and the immense amount of work that will go into it.  that extra effort of building the pluggability and the QA effort will come at the expense of more interesting features that we could build.

thoughts?