You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Mark Slater <li...@humanesoftware.com> on 2006/03/22 11:33:47 UTC

Jackrabbit JCA with Jencks and Tomcat

Has anyone tried to get Jackrabbit's JCA working with Jencks (or  
another JCA provider) in Tomcat? I'm pretty new to JCA but my  
understanding is that, ideally, the app server handles the repository  
lifecycle and individual servlets access it through JNDI. But the JCA  
support seems to not be usable with JNDI, and creates the repository  
inside itself. The reason I think I need JCA transactions is that I'm  
using both Jackrabbit and JDO in my project; I'd like them to  
participate in 2PC transactions.

The specific problem I'm seeing is actually during unit testing, so  
its outside Tomcat. Both JDO and Jackrabbit are configured to use a  
PostgreSQL installation, but with different user/pass, and in  
different databases within the installation. During the unit tests,  
I'm seeing 2 or more postgresql processes started for each file that  
contains integration tests (that actually use JDO and/or Jackrabbit  
instead of mocking them). By the time the tests finish, there are  
more than 50 open database connections; they are all released when  
maven finishes executing, but not before. Watching the active  
processes, it is obvious that no more than two of the postgresql  
processes are ever actively used, and they are always the most  
recently created processes (based on process ID). Just in case this  
is an OS issue, I'm running on MacOS X.

If anyone could provide guidance for this situation, I'd really  
appreciate it. Also, if it would be easier for me to simply be using  
a J2EE server like JBoss or Geronimo, I'd appreciate knowing that too  
(I should be able to use cactus to run the integration tests inside  
the app server, right?).

Thanks,

Mark

Re: Jackrabbit JCA with Jencks and Tomcat

Posted by Mark Slater <li...@humanesoftware.com>.
Well, the problem I'm getting doesn't appear to be localized to  
Jackrabbit or JDO, so I'm guessing its a Jenks issue. I'll ask the  
users there for more help.

But I did have an interesting thought that people here may have an  
answer for. Right now, I'm using two databases in the same PostgreSQL  
installation:

jdbc:postgresql://127.0.0.1:5432/jdo_objects
jdbc:postgresql://127.0.0.1:5432/jcr_objects

If I were to set jackrabbit and JDO to use the same database:
jdbc:postgresql://127.0.0.1:5432/project_objects

Would I be able to use non-XA transactions and have rollbacks apply  
to Jackrabbit and JDO? Are there any implications for Jackrabbit if  
it stores some data in a transaction which is then rolled back by  
another framework (assuming that all persistence managers are  
SimpleDbPersistenceManager)?

In the long run, I do want to be able to use different databases for  
JCR and JDO; I think it will be more scalable and better performing.  
But I could get away with a single database for a few more months...  
maybe the issue I'm getting would sort itself out by then.

Thanks!

Mark

On Mar 22, 2006, at 2:41 AM, A S Manzoor wrote:

> Hi Mark,
>
> Can't help you with Jencks but I have jackrabbit jca working under  
> Glassfish. Using cactus with any j2ee server should not pose any  
> problems.
>
> ./suhail
>
> On Wednesday, March 22, 2006, at 11:34AM, Mark Slater  
> <li...@humanesoftware.com> wrote:
>
>> Has anyone tried to get Jackrabbit's JCA working with Jencks (or
>> another JCA provider) in Tomcat? I'm pretty new to JCA but my
>> understanding is that, ideally, the app server handles the repository
>> lifecycle and individual servlets access it through JNDI. But the JCA
>> support seems to not be usable with JNDI, and creates the repository
>> inside itself. The reason I think I need JCA transactions is that I'm
>> using both Jackrabbit and JDO in my project; I'd like them to
>> participate in 2PC transactions.
>>
>> The specific problem I'm seeing is actually during unit testing, so
>> its outside Tomcat. Both JDO and Jackrabbit are configured to use a
>> PostgreSQL installation, but with different user/pass, and in
>> different databases within the installation. During the unit tests,
>> I'm seeing 2 or more postgresql processes started for each file that
>> contains integration tests (that actually use JDO and/or Jackrabbit
>> instead of mocking them). By the time the tests finish, there are
>> more than 50 open database connections; they are all released when
>> maven finishes executing, but not before. Watching the active
>> processes, it is obvious that no more than two of the postgresql
>> processes are ever actively used, and they are always the most
>> recently created processes (based on process ID). Just in case this
>> is an OS issue, I'm running on MacOS X.
>>
>> If anyone could provide guidance for this situation, I'd really
>> appreciate it. Also, if it would be easier for me to simply be using
>> a J2EE server like JBoss or Geronimo, I'd appreciate knowing that too
>> (I should be able to use cactus to run the integration tests inside
>> the app server, right?).
>>
>> Thanks,
>>
>> Mark
>>
>>
>


Re: Jackrabbit JCA with Jencks and Tomcat

Posted by A S Manzoor <il...@mac.com>.
Hi Mark,

Can't help you with Jencks but I have jackrabbit jca working under Glassfish. Using cactus with any j2ee server should not pose any problems.

./suhail

On Wednesday, March 22, 2006, at 11:34AM, Mark Slater <li...@humanesoftware.com> wrote:

>Has anyone tried to get Jackrabbit's JCA working with Jencks (or  
>another JCA provider) in Tomcat? I'm pretty new to JCA but my  
>understanding is that, ideally, the app server handles the repository  
>lifecycle and individual servlets access it through JNDI. But the JCA  
>support seems to not be usable with JNDI, and creates the repository  
>inside itself. The reason I think I need JCA transactions is that I'm  
>using both Jackrabbit and JDO in my project; I'd like them to  
>participate in 2PC transactions.
>
>The specific problem I'm seeing is actually during unit testing, so  
>its outside Tomcat. Both JDO and Jackrabbit are configured to use a  
>PostgreSQL installation, but with different user/pass, and in  
>different databases within the installation. During the unit tests,  
>I'm seeing 2 or more postgresql processes started for each file that  
>contains integration tests (that actually use JDO and/or Jackrabbit  
>instead of mocking them). By the time the tests finish, there are  
>more than 50 open database connections; they are all released when  
>maven finishes executing, but not before. Watching the active  
>processes, it is obvious that no more than two of the postgresql  
>processes are ever actively used, and they are always the most  
>recently created processes (based on process ID). Just in case this  
>is an OS issue, I'm running on MacOS X.
>
>If anyone could provide guidance for this situation, I'd really  
>appreciate it. Also, if it would be easier for me to simply be using  
>a J2EE server like JBoss or Geronimo, I'd appreciate knowing that too  
>(I should be able to use cactus to run the integration tests inside  
>the app server, right?).
>
>Thanks,
>
>Mark
>
>