On Wed, Oct 21, 2009 at 9:48 AM, Radu Ana-Maria <[email protected]> wrote: > hello, > > I'm working with: jackrabbit 1.5.6 + postgresql 8.4 , and i found a little > problem in my code with unclosed session even if i do session.logout() for > each new session. > > for example: > > *sessionPPL = repository.login(credentials); > workspaceList = sessionPPL.getWorkspace().getAccessibleWorkspaceNames(); > > for (String x : workspaceList ) { > sessionInUse = repository.login(credentials, x); > // and here i do something else.. like add some nodes etc. > sessionInUse .save(); > sessionInUse .logout(); > } > sessionPPL .logout();* > > and when i open the postgreSQL admin i see that i have more then 80 session > opend and not closed by jackrabbit.
you have ~80 (or ~40, dependening on your configuration) workspaces. the db sessions you're seeing are per workspace. they're not associated with any particular jcr session. > > -- sessionInUse .logout(); must stop the session opend in postgreSQL? or > not? if not, how can i stop this sessions from postgreSQL. you can configure a maxIdleTime per workspace. workspaces idling longer than the specified value will be closed automatically and resources released, see http://jackrabbit.apache.org/jackrabbit-configuration.html#JackrabbitConfiguration-Workspaceconfiguration otoh, your code sample looks kind of strange: for (String x : workspaceList ) { sessionInUse = repository.login(credentials, x); // ... } why do you do the same operations on all workspaces. you might consider redesigning your content model by reducing the number of workspaces. cheers stefan > > the api say: > *public void logout() -- Releases all resources associated with this > Session. This method should be called when a > Session is no longer needed.* > > Any help would be greatful > Thanks, > ana r. >
