You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Maxim Usoltsev <ma...@gmail.com> on 2010/12/15 11:42:09 UTC

jackrabbit-jca 2.2 - repository shutdows after every logout

Hi !
I'm tried to use 2.2 version of jackrabbit and got some strange behaviour:
After logging out jcr session i see following logs:

2010-12-15 13:30:08.054 INFO  [http-0.0.0.0-8080-4]
TransientRepository.java:423 Session closed
2010-12-15 13:30:08.057 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:1075 Shutting down repository...
2010-12-15 13:30:08.064 INFO  [http-0.0.0.0-8080-4]
SearchIndex.java:759 Index closed:
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/repository/index
2010-12-15 13:30:08.067 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:2143 shutting down workspace 'default'...
2010-12-15 13:30:08.069 INFO  [http-0.0.0.0-8080-4]
ObservationDispatcher.java:121 Notification of EventListeners stopped.
2010-12-15 13:30:08.083 INFO  [http-0.0.0.0-8080-4]
SearchIndex.java:759 Index closed:
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/default/index
2010-12-15 13:30:08.098 INFO  [http-0.0.0.0-8080-4]
DerbyConnectionHelper.java:94 Database
'/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/default/db'
shutdown.
2010-12-15 13:30:08.099 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:2150 workspace 'default' has been shutdown
2010-12-15 13:30:08.100 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:2143 shutting down workspace 'security'...
2010-12-15 13:30:08.102 INFO  [http-0.0.0.0-8080-4]
ObservationDispatcher.java:121 Notification of EventListeners stopped.
2010-12-15 13:30:08.106 INFO  [http-0.0.0.0-8080-4]
SearchIndex.java:759 Index closed:
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/security/index
2010-12-15 13:30:08.119 INFO  [http-0.0.0.0-8080-4]
DerbyConnectionHelper.java:94 Database
'/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/security/db'
shutdown.
2010-12-15 13:30:08.120 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:2150 workspace 'security' has been shutdown
2010-12-15 13:30:08.136 INFO  [http-0.0.0.0-8080-4]
DerbyConnectionHelper.java:94 Database
'/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/version/db'
shutdown.
2010-12-15 13:30:08.140 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:1170 Repository has been shutdown
2010-12-15 13:30:08.142 INFO  [http-0.0.0.0-8080-4]
TransientRepository.java:290 Transient repository shut down
2010-12-15 13:30:08.173 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:278 Starting repository...
2010-12-15 13:30:08.174 INFO  [http-0.0.0.0-8080-4]
LocalFileSystem.java:164 LocalFileSystem initialized at path
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/repository
2010-12-15 13:30:08.224 INFO  [http-0.0.0.0-8080-4]
LocalFileSystem.java:164 LocalFileSystem initialized at path
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/version
2010-12-15 13:30:08.420 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:1991 initializing workspace 'default'...
2010-12-15 13:30:08.421 INFO  [http-0.0.0.0-8080-4]
LocalFileSystem.java:164 LocalFileSystem initialized at path
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/default
2010-12-15 13:30:08.610 INFO  [http-0.0.0.0-8080-4]
SearchIndex.java:552 Index initialized:
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/repository/index
Version: 3
2010-12-15 13:30:08.687 INFO  [http-0.0.0.0-8080-4]
SearchIndex.java:552 Index initialized:
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/default/index
Version: 3
2010-12-15 13:30:08.688 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:1995 workspace 'default' initialized
2010-12-15 13:30:08.689 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:466 SecurityManager = class
org.apache.jackrabbit.core.security.simple.SimpleSecurityManager
2010-12-15 13:30:08.690 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:1991 initializing workspace 'security'...
2010-12-15 13:30:08.690 INFO  [http-0.0.0.0-8080-4]
LocalFileSystem.java:164 LocalFileSystem initialized at path
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/security
2010-12-15 13:30:08.833 INFO  [http-0.0.0.0-8080-4]
SearchIndex.java:552 Index initialized:
/home/max/work/jboss4/server/default/data/detachment-data/jackrabbit/workspaces/security/index
Version: 3
2010-12-15 13:30:08.835 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:1995 workspace 'security' initialized
2010-12-15 13:30:08.835 INFO  [http-0.0.0.0-8080-4]
SimpleSecurityManager.java:137 init: using Repository LoginModule
configuration for Jackrabbit
2010-12-15 13:30:08.836 INFO  [http-0.0.0.0-8080-4]
RepositoryImpl.java:380 Repository started (663ms)
2010-12-15 13:30:08.836 INFO  [http-0.0.0.0-8080-4]
TransientRepository.java:280 Transient repository initialized
2010-12-15 13:30:08.838 INFO  [http-0.0.0.0-8080-4]
TransientRepository.java:384 Session opened

My enviroment is:
gentoo linux
Java(TM) SE Runtime Environment (build 1.6.0_20-b02) - Java
HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
jboss 4.2.3
jackrabbit-jca 2.2.0

Repository retrieved using this code:
			repository = (Repository) new InitialContext().lookup("java:jcr/local");
and stored is application context

New jcr session created for each request (when needed) :

		boolean live = false;
		if (session != null) {
			try {
				live = session.isLive();
			} catch (IllegalStateException e) {
			}
		}
		if (!live) {
			debug("get jackrabbit session...");
			String userId = "admin";
			session = repository.login(new SimpleCredentials(userId,
"password".toCharArray()));
		}

and logged out when request ends

Now it looks like JCR Repository is shut down and initialized again
after every jcr session logout.

datasource xml is:

<connection-factories>
  <tx-connection-factory>
    <jndi-name>jcr/local</jndi-name>
    <xa-transaction/>
    <rar-name>jackrabbit-jca-2.2.0.rar</rar-name>
    <connection-definition>javax.jcr.Repository</connection-definition>
    <config-property name="repositoryURI"
type="java.lang.String">jcr-jackrabbit://jackrabbit</config-property>
    <config-property name="bindSessionToTransaction"
type="java.lang.Boolean">true</config-property>
    <config-property name="homeDir" type="java.lang.String">[my path
to jackrabbit repo directory here]</config-property>
  </tx-connection-factory>
</connection-factories>

Re: jackrabbit-jca 2.2 - repository shutdows after every logout

Posted by Maxim Usoltsev <ma...@gmail.com>.
2010/12/16 Cech. Ulrich <Ul...@aeb.de>:
> I should say, that the shutdown only occurs if no session is open any longer, so the way I described only holds one session open at least, so the repo does not close...

Thank you for the answer.
I'v used same workaround, but
http://jackrabbit.apache.org/jackrabbit-jca-resource-adapter.html :
"The Jackrabbit content repository embedded in the JCA package is
started when first accessed and shut down when the adapter is un- or
re-deployed."
What does it mean "content repository embedded in the JCA package" ?
Now can i achieve this behavior : " started when first accessed and
shut down when the adapter is un- or re-deployed." ?

Re: jackrabbit-jca 2.2 - repository shutdows after every logout

Posted by Dominik Klaholt <do...@mail.upb.de>.
Didn't the Java EE server pool the actual JCR sessions in earlier versions?
Such that, when a logout on a JCA handle had been called, the actual JCR
session was not logged out but returned to a connection pool. Furthermore
the size of this connection pool could be configured via min- and
max-pool-size entries in the jcr-ds.xml. Has this behaviour been removed?
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/jackrabbit-jca-2-2-repository-shutdows-after-every-logout-tp3088765p3206525.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: jackrabbit-jca 2.2 - repository shutdows after every logout

Posted by Maxim Usoltsev <ma...@gmail.com>.
2010/12/16 Jukka Zitting <jz...@adobe.com>:

> Hmm, that's a side-effect of JCR-2555 [1], where we made the JCA packaging independent of the underlying JCR implementation. There's no standard repository shutdown mechanism in JCR, so the only way to do proper resource management without custom JCR extensions is to make the repository automatically startup and shutdown itself based on open sessions [2].
>
> If this behavior is troublesome, please file an improvement request for fixing this. We could solve the issue either by automatically keeping an open session around until the JCA package gets undeployed or by adding special handling for Jackrabbit repositories.
>
> [1] https://issues.apache.org/jira/browse/JCR-2555
> [2] https://issues.apache.org/jira/browse/JCR-245
>
Created https://issues.apache.org/jira/browse/JCR-2847

RE: jackrabbit-jca 2.2 - repository shutdows after every logout

Posted by Jukka Zitting <jz...@adobe.com>.
Hi,

From: Cech. Ulrich [mailto:Ulrich.Cech@aeb.de]
> I should say, that the shutdown only occurs if no session is open any
> longer, so the way I described only holds one session open at least, so
> the repo does not close...

Hmm, that's a side-effect of JCR-2555 [1], where we made the JCA packaging independent of the underlying JCR implementation. There's no standard repository shutdown mechanism in JCR, so the only way to do proper resource management without custom JCR extensions is to make the repository automatically startup and shutdown itself based on open sessions [2].

If this behavior is troublesome, please file an improvement request for fixing this. We could solve the issue either by automatically keeping an open session around until the JCA package gets undeployed or by adding special handling for Jackrabbit repositories.

[1] https://issues.apache.org/jira/browse/JCR-2555
[2] https://issues.apache.org/jira/browse/JCR-245

BR,

Jukka Zitting

AW: jackrabbit-jca 2.2 - repository shutdows after every logout

Posted by "Cech. Ulrich" <Ul...@aeb.de>.
I should say, that the shutdown only occurs if no session is open any longer, so the way I described only holds one session open at least, so the repo does not close...

Bye,
Ulrich


AW: jackrabbit-jca 2.2 - repository shutdows after every logout

Posted by "Cech. Ulrich" <Ul...@aeb.de>.
<Now it looks like JCR Repository is shut down and initialized again after every jcr session logout.>
This is the same as in 2.1.x, we discovered the same behavior.

We solved this easily by adding a simple user which can login, but have no rights anywhere. This user is logged in initially, so the later connections start fast and the repository never shuts down in the meantime.

Bye,
Ulrich