Re: [appfuse-user] update user

2008-04-02 Thread tibi
great thanks!!! tibi Dustin Pearce wrote: > When you want to modify just a "part" of an object, you need to be > sure that you load the model from the database *before* you apply the > parameters posted from your web form. What is happening is that your > form is creating a *new* user instance

Re: [appfuse-user] update user

2008-04-01 Thread Dustin Pearce
When you want to modify just a "part" of an object, you need to be sure that you load the model from the database *before* you apply the parameters posted from your web form. What is happening is that your form is creating a *new* user instance and populating the fields from your small for

Re: [appfuse-user] update user

2008-04-01 Thread Matt Raible
Have you tried implementing the Preparable interface? This allows you to fetch your object from the database and only the fields you pass in on the request will be updated. See UserAction for an example. Matt On Tue, Apr 1, 2008 at 9:11 AM, tibi <[EMAIL PROTECTED]> wrote: > 2.0M5 > struts2.0 spr

Re: [appfuse-user] update user

2008-04-01 Thread tibi
2.0M5 struts2.0 spring hibernate thanks, tibi Matt Raible wrote: > Which version of AppFuse and which web framework are you using? > > On Tue, Apr 1, 2008 at 4:12 AM, tibi <[EMAIL PROTECTED]> wrote: > >> hi list, >> >> im not sure how to update an user when i only want to update one or two >

Re: [appfuse-user] update user

2008-04-01 Thread Matt Raible
Which version of AppFuse and which web framework are you using? On Tue, Apr 1, 2008 at 4:12 AM, tibi <[EMAIL PROTECTED]> wrote: > hi list, > > im not sure how to update an user when i only want to update one or two > fields. > using struts spring hibernate > > lets say i only want to change th

[appfuse-user] update user

2008-04-01 Thread tibi
hi list, im not sure how to update an user when i only want to update one or two fields. using struts spring hibernate lets say i only want to change the name. i make a form with hidden field with id and a normal field with name. when i enter my save method i have a user with only an id and name

Re: [appfuse-user] Update User from another Manager

2007-07-14 Thread Michael Horwitz
Absolute pleasure! Should have known - Exceptions trigger an automatic rollback. Enjoy the beach - I'm jealous! Mike. On 7/14/07, Dale Newfield <[EMAIL PROTECTED]> wrote: Dale Newfield wrote: > Michael Horwitz wrote: >> Any chance your action calls two managers and passes in an object >> obta

Re: [appfuse-user] Update User from another Manager

2007-07-13 Thread Dale Newfield
Dale Newfield wrote: Michael Horwitz wrote: Any chance your action calls two managers and passes in an object obtained from the first manager to the second? Upon further investigation, I've learned that the manager-manager call was *not* what was leading to the exception, but rather exactly w

Re: [appfuse-user] Update User from another Manager

2007-07-13 Thread Michael Horwitz
On 7/12/07, Dale Newfield <[EMAIL PROTECTED]> wrote: Michael Horwitz wrote: > Any chance your action calls two managers and passes in an object > obtained from the first manager to the second? Yes, but since I use OpenSessionInViewFilter, they're all part of a single session and should still be

Re: [appfuse-user] Update User from another Manager

2007-07-12 Thread Dale Newfield
Michael Horwitz wrote: Any chance your action calls two managers and passes in an object obtained from the first manager to the second? Yes, but since I use OpenSessionInViewFilter, they're all part of a single session and should still be valid, correct? Also just to check that it is the sa

Re: [appfuse-user] Update User from another Manager

2007-07-12 Thread Matt Raible
On 7/8/07, Dale Newfield <[EMAIL PROTECTED]> wrote: Matt Raible wrote: >> > The transaction boundaries are PROPOGATION_REQUIRED, which means >> > "participate in a transaction if one exists, otherwise, start a new >> > one". >> >> Where is this set? I've tried to update my AppFuse1.9.4 based ap

Re: [appfuse-user] Update User from another Manager

2007-07-12 Thread Michael Horwitz
On 7/12/07, Dale Newfield <[EMAIL PROTECTED]> wrote: Michael Horwitz wrote: > Matt is right - it definitely should work. I'm pretty sure I have done > this in the past without issue. Do you use spring1.x or spring2 ? I keep thinking my problem has to be in applicationContext-service.xml, and I

Re: [appfuse-user] Update User from another Manager

2007-07-12 Thread Dale Newfield
Michael Horwitz wrote: Matt is right - it definitely should work. I'm pretty sure I have done this in the past without issue. Do you use spring1.x or spring2 ? I keep thinking my problem has to be in applicationContext-service.xml, and I was looking for other (working) files to compare mine

Re: [appfuse-user] Update User from another Manager

2007-07-12 Thread Michael Horwitz
Matt is right - it definitely should work. I'm pretty sure I have done this in the past without issue. In terms of transaction/session handling the OpenSessionInViewFilter should take care of making sure the session is opened/closed once per request. The tx advice interceptors on the manager metho

Re: [appfuse-user] Update User from another Manager

2007-07-12 Thread Dale Newfield
Michael Horwitz wrote: The thing to check with lazy loading exceptions is whether you have the OpenSessionInViewFilter enabled in your web.xml I do have that enabled, but this isn't in the view layer. This is while the action is running, it calls a manager which does stuff. I have some busi

Re: [appfuse-user] Update User from another Manager

2007-07-12 Thread Michael Horwitz
The thing to check with lazy loading exceptions is whether you have the OpenSessionInViewFilter enabled in your web.xml (or the OpenEntityManagerInViewFilter if you are using JPA). By default these are commented out to be friendly to the iBatis people. Mike. On 7/11/07, Dale Newfield <[EMAIL PRO

Re: [appfuse-user] Update User from another Manager

2007-07-11 Thread Dale Newfield
Dale Newfield wrote: I have an action that's calling a manager that's calling another manager that then fails to lazily load a collection on a model object because "no session or session was closed". Is there some gotcha regarding manager-calling-manager and session management? Does the order

Re: [appfuse-user] Update User from another Manager

2007-07-11 Thread Dale Newfield
Matt Raible wrote: It should be OK to call one manager from another So I tried this again, and again I'm having problems. (This is why I had earlier concluded this was not a good practice.) I have an action that's calling a manager that's calling another manager that then fails to lazily l

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread Dale Newfield
cdtm wrote: Thanks for your help. It runs now as expected! I'm glad to help. But as Matt pointed out, if this solution caused you to need to replicate code, that would be bad, and if you'd rather call one Manager from another, you can do that instead. Change that injection from a dao to

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread Dale Newfield
Matt Raible wrote: > The transaction boundaries are PROPOGATION_REQUIRED, which means > "participate in a transaction if one exists, otherwise, start a new > one". Where is this set? I've tried to update my AppFuse1.9.4 based app to use spring2, and I'm now thinking that I may have done that i

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread cdtm
Thanks for your help. It runs now as expected! DNewfield wrote: > > cdtm wrote: >> SimplePresenceManager the manager which updates the users. >> In SimplePresenceManager I changed the constructor to >> >> public SimplePresenceManagerImpl(UserDao dao) throws EventingException { >>

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread Matt Raible
On 7/8/07, Dale Newfield <[EMAIL PROTECTED]> wrote: Matt Raible wrote: > It should be OK to call one manager from another And would you get the handle to the other Manager in the same way we do for daos, using spring injection? Yes. > The transaction boundaries are PROPOGATION_REQUIRED, whi

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread Dale Newfield
Matt Raible wrote: It should be OK to call one manager from another And would you get the handle to the other Manager in the same way we do for daos, using spring injection? The transaction boundaries are PROPOGATION_REQUIRED, which means "participate in a transaction if one exists, otherwi

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread Matt Raible
On 7/8/07, Dale Newfield <[EMAIL PROTECTED]> wrote: cdtm wrote: > I have a manager that gets some data from another source (via notification). > Upon reception of an event this manager has to update user information. So tell spring to inject the userDao into your other manager, and make calls to

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread Dale Newfield
cdtm wrote: SimplePresenceManager the manager which updates the users. In SimplePresenceManager I changed the constructor to public SimplePresenceManagerImpl(UserDao dao) throws EventingException { super(); this.userDao= dao; } Is this the correct

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread cdtm
Dale, thank for your quick response. For injecting the userDao I added the following into applicationContext.xml: SimplePresenceManager the manager which updates the users. In SimplePresenceManager I changed the constructor to public SimplePresenceManagerImpl(UserDao dao) t

Re: [appfuse-user] Update User from another Manager

2007-07-08 Thread Dale Newfield
cdtm wrote: I have a manager that gets some data from another source (via notification). Upon reception of an event this manager has to update user information. So tell spring to inject the userDao into your other manager, and make calls to it. Since the manager method boundary is the transa

[appfuse-user] Update User from another Manager

2007-07-08 Thread cdtm
Hi, I have a manager that gets some data from another source (via notification). Upon reception of an event this manager has to update user information. Therefore I tried to instantiate the UserManagerImpl by using its constructor, query for a user object (by getUserByUsername()) and save it afte