jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Lau <ml4li...@gmail.com>
Subject JCAConnectionRequestInfo leak in Jackrabbit JCA?
Date Thu, 28 Aug 2008 00:34:30 GMT
I am running Jackrabbit JCA 1.3.1 on JBoss 4.3, with an Oracle database.
I found that every time a new connection is made, an instance of
JCAConnectionRequestInfo is created and is never deallocated.  The
instance and the objects that it references (e.g. a SimpleCredential)
stay in memory until JBoss is shutdown.

I also ran tests with Jackrabbit JCA 1.4 (using jackrabbit-jca-1.4.rar
that I downloaded from a mirror site) and found that it has the
same problem.

The following is my jcr-ds.xml

==========================================================
<?xml version="1.0" encoding="UTF-8"?>
<connection-factories>
    <tx-connection-factory>
        <jndi-name>jcr/local</jndi-name>
        <xa-transaction/>
        <rar-name>jackrabbit-jca-1.4.rar</rar-name>
        <connection-definition>javax.jcr.Repository</connection-definition>
        <config-property name="homeDir" 
type="java.lang.String">/tmp/myrepository</config-property>
        <config-property name="configFile" 
type="java.lang.String">/opt/jboss/jboss-4.0.5.GA/server/default/userdata/repository.xml</config-property>
        <config-property name="bindSessionToTransaction" 
type="java.lang.Boolean">true</config-property>
        <application-managed-security/>
    </tx-connection-factory>
</connection-factories>
==========================================================

I ran a test inside JBoss similar to the one below:

==========================================================
    public void testLoginLogout() throws Exception {
        InitialContext ctx = new InitialContext();
        Repository repository = (Repository) ctx.lookup("java:jcr/local");
        for (int i = 0; i < 1000; i++) {
            Session session_ = repository.login(new SimpleCredentials("foo", 
"bar".toCharArray()));
            session_.logout();
        }
    }
==========================================================

Each login caused a new connection to be created; each connection had its own
instance of JCAConnectionRequestInfo; each instance of
JCAConnectionRequestInfo referenced its own instance of SimpleCredential.
After all the connections were timed out and destroyed, all instances of
JCAConnectionRequestInfo and SimpleCredential remained in memory.

I also tried logging in without a credential (by calling Repository.login()
without any input parameters).  In this case only one connection was created,
with an associated JCAConnectionRequestInfo instance, and the same connection
was reused for all 1000 logins.  When the connection was timed out and
destroyed, the JCAConnectionRequestInfo remained in memory until JBoss was
shutdown.

Has anyone seen this before?  Is there any configuration parameter that can
fix this?

Thanks,
Marvin

Mime
View raw message