Java – Attachment handling for web application with Jackrabbit

content-managementjavaspringweb-applications

I need to manage attachments on my Spring web application and I thought to use an open source repository.

My app it's a job approval system using J2EE / SPRING 3 Framework and Postgress DB to allow user to tracks the job,right through every step of the approval process.

It is a fully managed, collaborative system that operates from a central server and is accessed by a standard internet browser.

An user should be able to add an attach to a request or an approval step, so, I though to use Jackrabbit with Postgres database persistence manager.

I took a look to this post: http://onjava.com/pub/a/onjava/2006/10/04/what-is-java-content-repository.html?page=1

It's really interesting but, I've some question about this kind of solution :-

  • I seen that Jackrabbit standalone as a Derby database embedded solution for persistence, is it enough for a professional use of the repository with more than 50 request / days (with attachment) ?

  • Is there a reason for which I should use another database manager for persistence instead of the default one ?

Best Answer

When you choose the database for repository you should base your decision on the same criteria like choose the database for web application. For instance, respond yourself to question: if derby is good for jackrabbit, why not use derby as a database for web application.

From this point of view I recommend to use the same database for both. This also give you advantages for maintenance, you will need to know only one database and don't need to duplicate maintenance scripts.

I suggest to use a database with table spaces. Data for web application and attachment to be store in different table spaces for optimization. Even you can have one database for both web application and jackrabbit with different schema and table spaces. More you can use the same database connection of JEE container.

Do you need one commit for both (web application and jackrabbit) known as 2 phase commit? If yes I know spring can do it, but I can't help you with that because I didn't work with spring.