You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John Meredith <ps...@t-online.de> on 2003/05/08 01:05:15 UTC

Tapestry and hibernate

Hi,

I have a couple of question regards Tapestry and hibernate usage.

1. Where is the best place within the Tapestry framework to build my
hibernate session factory? Would it be advisable to use an EJB session
bean (as per the Vlib example), or is it appropriate in Global?

2. With regards to polymorphism and blocks: My little "play around with
tapestry" shop-app, has number of products which are subclasses of the
main product. Rather than setup a page for each product, I'd like to use
one page so the Block component seems like the way to go. My problem is:
How do I notify the page which Block needs to be rendered (depending on
the product)?

(Forgive me if these are stupid questions.)

Best regards and TIA,

  John

-- 
John Meredith <ps...@t-online.de>


Re: Tapestry and hibernate

Posted by Eric Everman <ev...@precedadesign.com>.
Hi John-

To answer questions #1:
Here is my code (with bits taken from others).  I uses a custom Engine and 
the IMonitor interface.  Using IMonitor is just one way among many to get a 
Hibernate Session.  What IMonitor has over other approaches is that it 
provides a safety net, ensuring that all opened Sessions are closed when 
the httpRequest completes.  I believe the code is fairly well document and 
has some usage notes and examples.

Let me know if you have questions,

Eric Everman

At 5/7/2003, you wrote:
>Hi,
>
>I have a couple of question regards Tapestry and hibernate usage.
>
>1. Where is the best place within the Tapestry framework to build my
>hibernate session factory? Would it be advisable to use an EJB session
>bean (as per the Vlib example), or is it appropriate in Global?
>
>2. With regards to polymorphism and blocks: My little "play around with
>tapestry" shop-app, has number of products which are subclasses of the
>main product. Rather than setup a page for each product, I'd like to use
>one page so the Block component seems like the way to go. My problem is:
>How do I notify the page which Block needs to be rendered (depending on
>the product)?
>
>(Forgive me if these are stupid questions.)
>
>Best regards and TIA,
>
>   John
>
>--
>John Meredith <ps...@t-online.de>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org