jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Lombart <christophe.lomb...@gmail.com>
Subject Re: hybrid Hibernate(JDBC)/OCM Objects
Date Fri, 17 Jul 2009 07:12:58 GMT
Just my point of view :
1/ If your are using Jackrabbit/OCM for just storing Blobs and use Hibernate
for your object mapping, you will add more complexicity in the code for
almost nothing. If it is mandatory to keep a RDBMS, use Hibernate (with blob
support).

2/ If your application is an heavy content application, replace Hibernate by
Jackrabbit and if needed use OCM.

3/ For "mutant RDBMS/JCR" applications (eg. a financial application which
needs one or more content modules), it is more complex. Try to make a clean
distinction between both database and if possible use 2 different
applications :
1. the first application will use the RDBMS (eg. the core financial
application in my example).
2. The second one is a content repository based on JCR. Of course, in a such
situation you have to find the best API to make requests from the first
application to the second one. Personally, I think that Sling [1] becomes a
great help because others applications can access easily to the content
repository through HTTP requests.

Later, you will see that your users (or customer) will find other
applications that can use the second application (the content repository).

[1] http://sling.apache.org/site/index.html

HTH
Christophe

2009/7/17 Jason Thrasher <jason@coachthrasher.com>

>
> Greetings Users,
> Does anyone have pointers on creating POJOs that have some fields stored in
> OCM, and relational/business logic stored in a relational DB?
> With a well established data model, DAO layer, and business layer in my app
> using Hibernate for JDBC into a MySQL database, only one object uses
> Jackrabbit to store binary file data, and it's mapped using a UUID into the
> relational model.  It works great, and I'm very happy with it.
>
> Now I'm adding features to the app that are very heavily content based, and
> I'd like to utilize Jackrabbit OCM for fields in the model that are content
> oriented, as it will be much more powerful than the relational model for
> this.  However, I need to preserve the relational integrity of the system,
> as this is not a content-only application.  I've tested pure OCM objects,
> and have build a DAO layer for them using generics, and it works fine.  The
> problem I'm facing is how to map between the relational and OCM systems,
> for
> a single object.
>
> I've started to explore this using the OCM object's "path" field as a
> unique
> identifier in the relational system.  I have one relational table for all
> content objects that has columns:
>        id, classname, path
> I think I can preserve the lazy-instantiation of the Hibernate system by
> creating a custom LazyInitializer and POJOEntityTuplizer, that would CRUD
> data from Jackrabbit whenever the hybrid model objects are CRUDed by
> Hibernate.  However, this looks really complicated, and there are very few
> google-able references online on doing something similar.  All I could find
> was this:
>
> http://www.theserverside.com/tt/articles/content/RemoteLazyLoadinginHibernate/article.html
> Which only seems to be a starting point.
>
> Has anyone done this, or have any pointers?  Am I going down the wrong
> path?
>
> thanks,
> Jason
>
> --
> View this message in context:
> http://www.nabble.com/hybrid-Hibernate%28JDBC%29-OCM-Objects-tp24526110p24526110.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message