[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread [EMAIL PROTECTED]
Are you using a conversation?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954771#3954771

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954771

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread javajedi
Yes, sorry I neglected to mention that.  Here is the relevant code:

@Stateful
  | @Scope(ScopeType.CONVERSATION)
  | @Name(campaignEditor)
  | public class CampaignEditorBean implements CampaignEditor {
  | 
  |   @Valid @In(required=false) @Out
  |   private Campaign campaign;
  | 
  |   @In(create=true)
  |   private Session session;
  | 
  |   @Begin(join=true)
  |   public String select() {...
  | 
  |   @End
  |   public String update() {...
  | ...
  | 
  | @Entity
  | @Name(campaign)
  | @Scope(ScopeType.SESSION)
  | public class Campaign {
  | ...
  | 

In my view, I reference properties on campaign.  Whenever I try to reference 
any property that is lazily initialized, I get the LazyInitializationException 
unless I first manually call 
sessionFactory.getCurrentSession().update(campaign).

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954773#3954773

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954773

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread [EMAIL PROTECTED]
The problem is the ScopeType.SESSION bit. This functionality is only for 
conversation-scoped data.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954774#3954774

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954774

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread javajedi
Thanks for the reply.  I modified the entity as follows:

@Entity
  | @Name(campaign)
  | @Scope(ScopeType.CONVERSATION)
  | public class Campaign {
  | ...
  | 

However, I still have the same problem.  Here is the debug output from Seam 
where it looks like it's resolving campaign:

2006-06-30 16:34:08,471 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] 
resolving name: campaign
  | 2006-06-30 16:34:08,471 DEBUG [org.jboss.seam.contexts.Contexts] found in 
conversation context: campaign
  | 2006-06-30 16:34:08,471 DEBUG [org.apache.myfaces.el.VariableResolverImpl] 
Variable 'campaign' could not be resolved.
  | 2006-06-30 16:34:08,471 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] 
resolved name to seam component
  | 

Any other suggestions?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954775#3954775

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954775

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread [EMAIL PROTECTED]
Did you actually retrieve the Campaign from the conversational persistence 
context? Or is it some other object you had lying around before the 
conversation started?

It is really not helpful when you chop out the actually intersting code in 
select() and update().

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954776#3954776

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954776

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread javajedi
Sorry.  The Campaign came from another SFSB (CampaignManager), where it came 
from a list using @DataModelSelection.  Here's the code without the omissions:

@Stateful
  | @Scope(ScopeType.CONVERSATION)
  | @Name(campaignEditor)
  | public class CampaignEditorBean implements CampaignEditor {
  | 
  |   @In
  |   private CampaignManager campaignManager;
  | 
  |   @Valid @In(required=false) @Out
  |   private Campaign campaign;
  | 
  |   @In(create=true)
  |   private Session session;
  | 
  |   @Begin(join=true)
  |   public String select() {
  | campaign = campaignManager.getSelectedCampaign();
  | return editCampaign;
  |   }
  | 
  |   @End
  |   public String update() {
  | session.update(campaign);
  | return campaigns;
  |   }
  | }
  | 
  | @Stateful
  | @Scope(ScopeType.SESSION)
  | @Name(campaignManager)
  | public class CampaignManagerBean implements CampaignManager {
  | 
  |   @DataModel
  |   private ListCampaign campaigns;
  | 
  |   @DataModelSelection
  |   private Campaign campaign;
  | 
  |   public Campaign getSelectedCampaign() {
  | return campaign;
  |   }
  | }

So yes, I guess you could say the Campaign was lying around before the 
campaign started.  Is there any way that I can use the @DataModelSelection 
campaign in the conversation, so I can get around the 
LazyInitializationExceptions?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954777#3954777

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954777

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread [EMAIL PROTECTED]
Thats what I guessed. So you need to do:


  |   @Begin(join=true)
  |   public String select() {
  | campaign = session.lock( campaignManager.getSelectedCampaign(), 
LockMode.NONE );
  | return editCampaign;
  |   }
  | 

In order to get a Campaign that is associated with the conversation. After 
doing this once at the beginning of the conversation, you will not need to do 
it again.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954779#3954779

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954779

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread javajedi
Awesome.  That works great.  Thanks so much for the help.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954781#3954781

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954781

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: How do I reattach entities using a ManagedHibernateSessi

2006-06-30 Thread javajedi
I spoke a little too soon.  The second time that I try to invoke 
CampaignEditorBean.select on the same campaign, I get a reassociated object 
has dirty collection HibernateException from the session.lock call.

Caused by: org.hibernate.HibernateException: reassociated object has dirty 
collection
  | at 
org.hibernate.event.def.OnLockVisitor.processCollection(OnLockVisitor.java:45)
  | at 
org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)
  | at 
org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:61)
  | at 
org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
  | at 
org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:123)
  | at 
org.hibernate.event.def.AbstractReassociateEventListener.reassociate(AbstractReassociateEventListener.java:78)
  | at 
org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:59)
  | at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:583)
  | at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:575)
  | at CampaignEditorBean.select(CampaignEditorBean.java:61)

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3954782#3954782

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3954782

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user