-
1. Re: Understanding Conversations
gavin.king Feb 7, 2006 10:42 PM (in response to chane)I don't understand what you mean. Seam components are not transactional.
Are you talking about entities in a Seam-managed persistence context? -
2. Re: Understanding Conversations
chane Feb 7, 2006 11:08 PM (in response to chane)Sorry, yes I am talking about the Entities. To walk through on of the examples, I'm looking at the exampe/hibernate.../HotelBookingAction.java.
A conversation is started when the find() method is called. I see that the hotels variable is set based on a call to the persistence engine (in this case it is the bookingDatabase).
Then a view is returned displaying all of the hotels and the state is saved on the client. When a users selects a hotel it is saved in the hotel variable.
In the bookHotel() method the booking object is created with references to a hotel and a user.
When the confirm() method is called to save the booking, I am trying to understand some of the mechanics of how this works. Primarly, the persist(booking) takes the booking object and saves it to the database.
In the booking object there is a reference to a Hotel. Somewhere during the http request that calls confirm(), doesn't the hotel reference have to be reassociated with the Session so that a TransientObjectException is not thrown.
Hope this is clearer. I'm trying to understand how transactions work in Seam and how persistence is managed in a conversation.
Chris.... -
3. Re: Understanding Conversations
gavin.king Feb 7, 2006 11:17 PM (in response to chane)Seam-managed persistence contexts are extended pcs. As is the container-managed persistence context in the SFSB. Reassociation of a container-managed pc with a transaction always happens automatically when the the component is invoked.
In the current releases of Hibernate (and the current spec revision), reassociation of a Seam-managed persistence context with a transaction happens automatically when the EM or Session is invoked. (Actually this is changing in the final draft of the spec.)
I suggest you read what the EJB3 spec has to say about this stuff. -
4. Re: Understanding Conversations
chane Feb 8, 2006 12:05 AM (in response to chane)Gavin,
Thanks for responding and pointing me in the right direction. It has been a while since I looked at EJBs (actually 2.x timeframe). I can already tell it makes sense just reading section 5.6 (Persistent Contexts - in the persistence spec). I now have lots of reading/learning to do in my spare time...
Thanks again,
Chris....