[jboss-user] [JBoss Seam] - POJO with conversational scope

joris77 do-not-reply at jboss.com
Wed Mar 28 19:09:36 EDT 2007


I have a POJO that i want to use as a Seam bean with conversational scope and I have an entity "Person" that I store as an instance variable/javabean property on that POJO. Like this ...


  | ...
  | @Name("depot")
  | @Scope(ScopeType.CONVERSATION)
  | public class Depot {
  | 
  | 	@Logger
  | 	private Log log;
  | 	
  | 	private Person person;
  | ...

What I expect is that if the instance variable is set after the first request (I do that in my code) of the conversation that it remains there until the conversation is ended by the @End annotation of one of depot's action methods.

Is this correct?

In reality after the first postback from the client the instance variable is null.

If I take a look in my logging I see that my javabean is created and destroyed each request:


  | 00:49:45,171 INFO  [STDOUT] Constructing depot
  | 00:49:45,171 WARN  [AbstractEntityManagerImpl] Calling joinTransaction() on a non JTA EntityManager
  | 00:49:45,171 INFO  [Depot] Create depot
  | 00:49:45,234 WARN  [AbstractEntityManagerImpl] Calling joinTransaction() on a non JTA EntityManager
  | 00:49:45,312 INFO  [STDOUT] Hibernate: select material0_.id as id4_, material0_.version as version4_, material0_.created_by as created3_4_, material0_.created_on as created4_4_, material0_.last_modified_by as last5_4_, material0_.last_modified_on as last6_4_, material0_.description as descript7_4_, material0_.blocked as blocked4_, material0_.material_type as material11_4_, material0_.bar_code as bar9_4_, material0_.reason_for_blocking as reason10_4_ from material material0_ where material0_.bar_code=?
  | 00:49:45,359 INFO  [STDOUT] Hibernate: select materialty0_.id as id5_0_, materialty0_.version as version5_0_, materialty0_.created_by as created3_5_0_, materialty0_.created_on as created4_5_0_, materialty0_.last_modified_by as last5_5_0_, materialty0_.last_modified_on as last6_5_0_, materialty0_.name as name5_0_, materialty0_.description as descript8_5_0_ from material_type materialty0_ where materialty0_.id=?
  | 00:49:45,406 INFO  [STDOUT] Hibernate: select checkout0_.id as id1_, checkout0_.version as version1_, checkout0_.created_by as created3_1_, checkout0_.created_on as created4_1_, checkout0_.last_modified_by as last5_1_, checkout0_.last_modified_on as last6_1_, checkout0_.person as person1_, checkout0_.material as material1_, checkout0_.checkin_date as checkin7_1_, checkout0_.checkout_date as checkout8_1_ from checkout checkout0_ where checkout0_.material=? and (checkout0_.checkin_date is null)
  | 00:49:45,453 INFO  [STDOUT] Hibernate: select person0_.id as id2_0_, person0_.version as version2_0_, person0_.created_by as created3_2_0_, person0_.created_on as created4_2_0_, person0_.last_modified_by as last5_2_0_, person0_.last_modified_on as last6_2_0_, person0_.last_name as last7_2_0_, person0_.middle_name as middle8_2_0_, person0_.initials as initials2_0_, person0_.bar_code as bar10_2_0_ from person person0_ where person0_.id=?
  | 00:49:45,531 WARN  [AbstractEntityManagerImpl] Calling joinTransaction() on a non JTA EntityManager
  | 00:49:45,562 INFO  [Depot] Destroy depot
  | 

I am afraid I am missing the point here, somebody explain me how conversations are supposed to work?

Do POJO conversations differ from EJB conversations?

Thanks anyway,

Joris Wijlens

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032581#4032581

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032581



More information about the jboss-user mailing list