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

soaexpert
Champ in-the-making
Champ in-the-making
I don't see the point in using a document-oriented database to store process states.
Sebastian, deploying everything in the cloud, e.g. EC2 or the like, is the reason for this requirement.

And to keep the state of process, don´t we need of a hard relation base. If we work with models (OOP), they can be stored by  a key-value system.

More distribute computation, more SOA architecture, because normally the bases noSQL have rest interface 🙂

activiti-admin
Champ in-the-making
Champ in-the-making
I'd suggest the requirement of having pluggable persistence engine will detract from what your setting out to achieve i.e a BPM engine, so steer clear of it! The ORM debate tends to do this from what I can see.

That said have you thought about implementing the Active Record pattern. There are a couple of Java implementations that have taken the Ruby implementation as a basis.

http://www.javalobby.org/articles/activeobjects/
http://arjava.sourceforge.net/

We (like many organisations) have/ are having this debate and it always appears that JPA is to complex, Ibatis is great but doesn't reduce code and that all we really need is a simple Active Record type mechanism.

Good Luck  Smiley Wink

sebastian_s
Champ in-the-making
Champ in-the-making
Hello Bernd, hello Felipe,

There was a discussion on NoSQL related to the jBPM5 roadmap on the jBPM developers' mailing list a few days or weeks ago. There were also voices asking to support non-relational databases. I don't see the point in using a document-oriented database to store process states.

Hi Sebastian, so noSQL isn´t only document based. You can have another approach like key-value ( Redis is my choice) or MongoDB ( was developed by DoubleClick team) that use both concepts.

thanks for clarifyfing on this. For everyone capable of the German language there is an article on heise.de which gives a good overview about the different types of noSQL-databases:

http://www.heise.de/open/artikel/NoSQL-im-Ueberblick-1012483.html

Regards
Sebastian

sebastian_s
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?

What about providing the possibility to switch the persistence provider while limiting the coverage through the QA-matrix? Or we could commit on providing a persistence layer allowing the use of 2 different persistent providers. If I understood you right there will be a kind of persistence layer anyway to make it possible to use noSQL-databases, right?

I would have excpected the project to go the JPA-way but it seems there are quite some obstacles. I am not sure what to think about iBatis/MyBatis since I have not known the project before it was mentioned in relation to Activiti.

just my 2 cents

Sebastian

yury_h
Champ in-the-making
Champ in-the-making
I just found this discussion. After browsing through the source code to see what the guys were using in their persistance layer, I was (at first) very surprised to have found iBatis. This led to the discussion started in Tom's blog posted by Bernd here.

But after giving it a second thought, I think what Activiti is using internally is not a big deal. In your spring configuration you can define 1 DataSource which will be used by your JPA configuration in the EntityManagerFactory bean and by Activiti/iBatis. If the project is configured like that using JTA, there shouldn't be a problem.

For me another strong argument to support JPA was the possibility to plug in my JPA domain model, specifically in case I want to reference/update my Business Domain Objects as process variables. In jBPM we have options like having to use Hibernate directly, no JPA (not nice if your own project uses JPA…), save objects like BLOBs (that's ugly too), or just use references of primitive types like String or Long being normally ID's of your BO's and load your BO's in the Java code. Instead if I could reference a JPA entity directly, it would be really nice.

Of course you may argue, why use JPA entities directly, one should better call services instead which encapsulate those objects. Well the use case I think about is when I use the process to manage the state of my business process in a "process-driven" service. Example: a service called CreateInsuranceClaim starts internally a workflow which in turn may orchestrate several other services but also have its own domain objects. For the clients using that service all those details would still remain hidden.

For what I understood, Tom was going to provide variable JPA persistence independantly from how their internal persistance is managed. If that's the case, I don't see a problem with iBatis. But if in the meantime they have decided to support JPA for their own persistence too, even better for me.  Smiley Happy

tombaeyens
Champ in-the-making
Champ in-the-making
For what I understood, Tom was going to provide variable JPA persistence independantly from how their internal persistance is managed. If that's the case, I don't see a problem with iBatis.

exactly.  same for a number of other entities that might be referenced.  like e.g. non-jpa-hibernate entities, JCR nodes, records in a table,…

chrisc
Champ in-the-making
Champ in-the-making
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

We created a lightweight, high performance 'wrapper' for persistence frameworks, exPOJO to achieve the very goals you mention above. It allows developers of libraries/frameworks that require persistence to write their code to a persistence framework agnostic API which is a very thin wrapper over other APIs like JDO, JPA or direct Hibernate.

This allows users of frameworks written with exPOJO to plug in their favourite (or company mandated) persistence implementation. It also allows code to be easily ported from one persistence framework to another with very little code changes.

It's all made possible by building upon the Exposed Domain Model Pattern detailed in Chris Marshall's book 'POJOs in Action'.

exPOJO comes with a very lightweight servlet filter than 'can', if required, help out with exPOJO's dependency injection which requires no annotations but that's not mandatory as you could just as easily use it with Spring.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Sorry, but I honestly hate wrappers of tese kinds. They almost always limit you in what you can do, are not a (defacto) standard, often not maintained for a long time etc…