-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: hibernate in portlet
PostPosted: Wed Apr 12, 2006 12:40 am 
Newbie

Joined: Tue Apr 11, 2006 11:57 pm
Posts: 1
is someone can show me how to use hibernate with portlet


Top
 Profile  
 
 Post subject: Hibernate in a portlet
PostPosted: Sat May 27, 2006 10:03 pm 
Newbie

Joined: Thu Mar 23, 2006 6:52 pm
Posts: 5
Location: Calgary
I'm currently using Hibernate inside a series of WebSphere portlets (8 in total).

What would you like to know?


Top
 Profile  
 
 Post subject: Hibernate, Spring and JSR-168 portlet
PostPosted: Sat May 27, 2006 10:21 pm 
Newbie

Joined: Tue Mar 14, 2006 3:20 pm
Posts: 14
I am using the three together succesfully with Vignette Portal. What would you like to know?

Thanks,
Eric


Top
 Profile  
 
 Post subject: Re: hibernate in portlet
PostPosted: Mon Sep 07, 2009 3:40 pm 
Newbie

Joined: Mon Sep 07, 2009 2:58 pm
Posts: 3
Hi! I know this post is maybe outdated but i have this question and I hope someone could help me out... I want to know how can I share the same hibernate session between portlets... I'm developing several portlets but all of them will access the same database, the only difference between them is that each one will handle different entities, but I need them to share the same hibernate session factory instead of each one creating a different one.... can somebody help me with this?

by the way i'm using Liferay

thanks


Top
 Profile  
 
 Post subject: Re: hibernate in portlet
PostPosted: Mon Sep 07, 2009 8:41 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
You'll need to front the Hibernate Session through either a Stateless Session Bean or a Web Service.

Separate portlets can run on separate JVMs remember. That really makes sharing a Hibernate Session in the purest sense impossible.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: hibernate in portlet
PostPosted: Mon Sep 07, 2009 11:16 pm 
Newbie

Joined: Mon Sep 07, 2009 2:58 pm
Posts: 3
Thanks Cameron! I'll give that a try!


Top
 Profile  
 
 Post subject: Re: hibernate in portlet
PostPosted: Mon Sep 07, 2009 11:37 pm 
Newbie

Joined: Mon Sep 07, 2009 2:58 pm
Posts: 3
Cameron, that means that the best way to use hibernate in several portlets is letting them to create their own session factory to access the database (using different cfg files with almost the same configuration)?


Top
 Profile  
 
 Post subject: Re: hibernate in portlet
PostPosted: Tue Sep 08, 2009 7:56 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Quote:
the best way to use hibernate


The alternative is to use another component like a SLSB or Web Service to front the Session.

Even when an app gets clustered on multiple JVMs, you get multiple Sessions. That's just the way it scales.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.