org.hippoecm.hst.core.jcr.pool.NoAvailableSessionException:

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

org.hippoecm.hst.core.jcr.pool.NoAvailableSessionException:

ramandeep0015
Hi Team I really appericiate your support, I was working on hippo cms project and with your support i am able to complete the project THANK YOU VERY MUCH I have one more problem :) i am getting jcr session in doBeforeRender method and with jcr i am creating many nodes in CMS but i get following exception in between everytime org.hippoecm.hst.core.jcr.pool.NoAvailableSessionException: No session is available now. Probably the session pool was exhasuted. here is my code for getting the session and i am doing session.save(); in the last of code creating session once in doBeforeRender method repository = HippoRepositoryFactory .getHippoRepository("rmi://localhost:1299/hipporepository"); jcrSession = repository.login("admin", "admin".toCharArray()); Please help me THanks
Reply | Threaded
Open this post in threaded view
|

Re: org.hippoecm.hst.core.jcr.pool.NoAvailableSessionException:

Mathijs den Burger
Hi,

Do you logout the session once you're done?

I'm not sure what you are trying to achieve, but in general the
rendering phase of a page (i.e. the 'doBeforeRender' method) is not
the ideal place to create many nodes, or even to create any node.
Better use the 'doAction' method, which is called when a form is
submitted [1].
Instead of hard-coding the admin user and password, a session with
correct write-access can be obtained via
BaseHstComponent#getPersistableSession. For a more elaborate example
of persisting data via workflow, have a look at the Comments class
[2] in the online GoGreen demo [3].

hope this helps,
Mathijs

[1] http://www.onehippo.org/7_7/library/concepts/component-development/hst-2-forms.html
[2] http://svn.onehippo.org/repos/hippo/hippo-demos/hippo-go-green/trunk/site/src/main/java/com/onehippo/gogreen/components/common/Comments.java
[3] http://www.onehippo.com/en/products/cms/try


On Wed, Oct 24, 2012 at 8:39 AM, ramandeep0015 <[hidden email]> wrote:

> Hi TeamI really appericiate your support, I was working on hippo cms project
> and with your support i am able to complete the project THANK YOU VERY MUCHI
> have one more problem :)i am getting jcr session in doBeforeRender method
> and with jcr i am creating many nodes in CMSbut i get following exception in
> between
> everytime*org.hippoecm.hst.core.jcr.pool.NoAvailableSessionException: No
> session is available now. Probably the session pool was exhasuted.*here is
> my code for getting the session and i am doing session.save(); in the last
> of codecreating session once in doBeforeRender method repository        =
> HippoRepositoryFactory
> .getHippoRepository("rmi://localhost:1299/hipporepository");
> jcrSession = repository.login("admin", "admin".toCharArray());Please help me
> THanks
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/org-hippoecm-hst-core-jcr-pool-NoAvailableSessionException-tp7579589.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html