You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Phillip Rhodes <sp...@rhoderunner.com> on 2007/04/24 22:43:55 UTC

associating jackrabbit content to your application database objects?

Hi everyone,
Just wondering if anyone has thought about this problem.  I store different types of objects in jackrabbit (e.g. Images, Thumbnails, Galleries, Html Content, etc)...  In my application, I have a database model (e.g. products, profiles).  Each object in my database model is associated to jackrabbit content.  For example, a product may have images.

I find myself having to create database objects that represent my jackrabbit items.  For example, I will create a "Image" object that is a database object.  This database record that represents an image node in jackrabbit is associated to products, and stores the path to the node that stores the image...

One problem that I am concerned about is the possiblity of my jackrabbit repository getting out of sync with my database table.  There may be other issues that I haven't considered.

I would appreciate some thoughts on this.
Thanks!

Phillip



Re: associating jackrabbit content to your application database objects?

Posted by Alexandru Popescu ☀ <th...@gmail.com>.
On 4/25/07, Darren Hartford <dh...@ghsinc.com> wrote:
> Hi Phillip,
> I have run into this too, and although it is a common problem when you
> have multiple data sources (jackrabbit, RDBMS, filesystem, XML database,
> etc) there is no available solution or best practice.
>

Well,  there is a solution for this XA transactions, but I would not
recommend them except very special cases, as they tend to become app
bottlenecks. Sometimes programmatic XA-like coding may perform better
while assuring your data consistency.

bests,

./alex
--
.w( the_mindstorm )p.
_____________________________________
  Alexandru Popescu, OSS Evangelist
TestNG/Groovy/AspectJ/WebWork/more...
  Information Queue ~ www.InfoQ.com


> The only recommendation is to define one as the 'primary' datasource and
> create a check-program based on the 'primary' datasource to audit the
> peripherial datasources and identify items that are missing or may have
> discrepancies in dates based on expectation (the image is from 2004, but
> the item in the RDBMS is a new item in 2007).
>
> My two coppers,
> -D
>
> > -----Original Message-----
> > From: Phillip Rhodes [mailto:spamsucks@rhoderunner.com]
> > Sent: Tuesday, April 24, 2007 4:44 PM
> > To: users
> > Subject: associating jackrabbit content to your application
> > database objects?
> >
> > Hi everyone,
> > Just wondering if anyone has thought about this problem.  I
> > store different types of objects in jackrabbit (e.g. Images,
> > Thumbnails, Galleries, Html Content, etc)...  In my
> > application, I have a database model (e.g. products,
> > profiles).  Each object in my database model is associated to
> > jackrabbit content.  For example, a product may have images.
> >
> > I find myself having to create database objects that
> > represent my jackrabbit items.  For example, I will create a
> > "Image" object that is a database object.  This database
> > record that represents an image node in jackrabbit is
> > associated to products, and stores the path to the node that
> > stores the image...
> >
> > One problem that I am concerned about is the possiblity of my
> > jackrabbit repository getting out of sync with my database
> > table.  There may be other issues that I haven't considered.
> >
> > I would appreciate some thoughts on this.
> > Thanks!
> >
> > Phillip
> >
> >
> >
>

RE: associating jackrabbit content to your application database objects?

Posted by Shaun Barriball <sb...@yahoo.co.uk>.
Hi Phillip,

We have addressed a similar problem with our JCR-170 based application.

While we want all the benefits of JackRabbit we also need to be able to use
traditional relational database tables for reporting. We've solved this by
creating a small number of tables that represent our "Content Warehouse".
We've then implemented an standard JCR EventListener which filters JCR
events looking for anything that requires an update to the warehouse.

Of course, there are some situations where an Event may be cause an error
etc and therefore the Warehouse gets out of date. In this scenario it may
also justify a batch sync facility, perhaps run on startup, which ensures
the Warehouse is 100% consistent.

This strategy is working well for us.

Regards,
Shaun. 

-----Original Message-----
From: Phillip Rhodes [mailto:spamsucks@rhoderunner.com] 
Sent: 24 April 2007 21:44
To: users
Subject: associating jackrabbit content to your application database
objects?

Hi everyone,
Just wondering if anyone has thought about this problem.  I store different
types of objects in jackrabbit (e.g. Images, Thumbnails, Galleries, Html
Content, etc)...  In my application, I have a database model (e.g. products,
profiles).  Each object in my database model is associated to jackrabbit
content.  For example, a product may have images.

I find myself having to create database objects that represent my jackrabbit
items.  For example, I will create a "Image" object that is a database
object.  This database record that represents an image node in jackrabbit is
associated to products, and stores the path to the node that stores the
image...

One problem that I am concerned about is the possiblity of my jackrabbit
repository getting out of sync with my database table.  There may be other
issues that I haven't considered.

I would appreciate some thoughts on this.
Thanks!

Phillip



Re: associating jackrabbit content to your application database objects?

Posted by paksegu <pa...@yahoo.com>.
what u can is create ur database as you wold normally do (primary key, foreign key relationship, all that intergrity stufff) the and then you add the url of path stored in jackrabbit. that if you want to use both jack rabbit and a database at the same time. I am doing something similar where jackrabbit servers as the first initail repository to store content as opposed to a filesystem

Phillip Rhodes <sp...@rhoderunner.com> wrote:  Hi everyone,
Just wondering if anyone has thought about this problem. I store different types of objects in jackrabbit (e.g. Images, Thumbnails, Galleries, Html Content, etc)... In my application, I have a database model (e.g. products, profiles). Each object in my database model is associated to jackrabbit content. For example, a product may have images.

I find myself having to create database objects that represent my jackrabbit items. For example, I will create a "Image" object that is a database object. This database record that represents an image node in jackrabbit is associated to products, and stores the path to the node that stores the image...

One problem that I am concerned about is the possiblity of my jackrabbit repository getting out of sync with my database table. There may be other issues that I haven't considered.

I would appreciate some thoughts on this.
Thanks!

Phillip





Ransford Segu-Baffoe

paksegu@yahoo.com
paksegu@NoqturnalMediaSystems.com

http://www.noqturnalmediasystems.com/
http://www.noqturnalmediasystems.com/Serenade/
https://serenade.dev.java.net/
       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

RE: associating jackrabbit content to your application database objects?

Posted by Darren Hartford <dh...@ghsinc.com>.
Hi Phillip,
I have run into this too, and although it is a common problem when you
have multiple data sources (jackrabbit, RDBMS, filesystem, XML database,
etc) there is no available solution or best practice.

The only recommendation is to define one as the 'primary' datasource and
create a check-program based on the 'primary' datasource to audit the
peripherial datasources and identify items that are missing or may have
discrepancies in dates based on expectation (the image is from 2004, but
the item in the RDBMS is a new item in 2007).

My two coppers,
-D

> -----Original Message-----
> From: Phillip Rhodes [mailto:spamsucks@rhoderunner.com] 
> Sent: Tuesday, April 24, 2007 4:44 PM
> To: users
> Subject: associating jackrabbit content to your application 
> database objects?
> 
> Hi everyone,
> Just wondering if anyone has thought about this problem.  I 
> store different types of objects in jackrabbit (e.g. Images, 
> Thumbnails, Galleries, Html Content, etc)...  In my 
> application, I have a database model (e.g. products, 
> profiles).  Each object in my database model is associated to 
> jackrabbit content.  For example, a product may have images.
> 
> I find myself having to create database objects that 
> represent my jackrabbit items.  For example, I will create a 
> "Image" object that is a database object.  This database 
> record that represents an image node in jackrabbit is 
> associated to products, and stores the path to the node that 
> stores the image...
> 
> One problem that I am concerned about is the possiblity of my 
> jackrabbit repository getting out of sync with my database 
> table.  There may be other issues that I haven't considered.
> 
> I would appreciate some thoughts on this.
> Thanks!
> 
> Phillip
> 
> 
> 

Re: associating jackrabbit content to your application database objects?

Posted by Phillip Rhodes <sp...@rhoderunner.com>.
Okay everyone, this is what I am thinking of doing...

My application allows users to upload images, pdfs, word documents, etc..  My users can associate these nodes to objects in a database (i.e. user can pick a photo to use for their profile)

In order to make these associations, I am going to store a representation of the Content (image, html snippet, pdf document) in a database using the hibernate annotations/springframework.  I will keep the two (jackrabbit and db) in sync (TBD)

Benefits to using jackrabbit:
1) Do not have to write any lucene indexing code for my content.  If someone adds a pdf document,html document, whatever, it's indexed and available for searching
2) Hierarchical structuring of content.  
3) jcr access to content repository
4) ability to use jackrabbit versioning capabilities (e.g.  can rollback to image for a product to a previous version)

Can anyone think of any additional benefits?

Since this library i have is under apache license, can you think of any additional content types that I should represent in the database?  Perhaps, I should go with a table to represent an infinite number of node types vs. specific tables per type (one table called jackrabbit_item vs. tables called image_content,html_content,textile_content).

I would like this to be a good bridge from the database to jackrabbit/jcr repos.


Phillip


----- Original Message -----
From: "Phillip Rhodes" <sp...@rhoderunner.com>
To: "users" <us...@jackrabbit.apache.org>
Sent: Tuesday, April 24, 2007 4:43:55 PM (GMT-0500) America/New_York
Subject: associating jackrabbit content to your application database objects?

Hi everyone,
Just wondering if anyone has thought about this problem.  I store different types of objects in jackrabbit (e.g. Images, Thumbnails, Galleries, Html Content, etc)...  In my application, I have a database model (e.g. products, profiles).  Each object in my database model is associated to jackrabbit content.  For example, a product may have images.

I find myself having to create database objects that represent my jackrabbit items.  For example, I will create a "Image" object that is a database object.  This database record that represents an image node in jackrabbit is associated to products, and stores the path to the node that stores the image...

One problem that I am concerned about is the possiblity of my jackrabbit repository getting out of sync with my database table.  There may be other issues that I haven't considered.

I would appreciate some thoughts on this.
Thanks!

Phillip