Return-Path: Delivered-To: apmail-jakarta-turbine-user-archive@apache.org Received: (qmail 72518 invoked from network); 3 Feb 2003 16:07:48 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 3 Feb 2003 16:07:48 -0000 Received: (qmail 18942 invoked by uid 97); 3 Feb 2003 16:09:17 -0000 Delivered-To: qmlist-jakarta-archive-turbine-user@nagoya.betaversion.org Received: (qmail 18934 invoked from network); 3 Feb 2003 16:09:16 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 3 Feb 2003 16:09:16 -0000 Received: (qmail 68054 invoked by uid 500); 3 Feb 2003 16:06:26 -0000 Mailing-List: contact turbine-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Turbine Users List" Reply-To: "Turbine Users List" Delivered-To: mailing list turbine-user@jakarta.apache.org Received: (qmail 68019 invoked from network); 3 Feb 2003 16:06:26 -0000 Received: from mail.bynum.com (HELO blr02.bynum.com) (64.79.231.74) by daedalus.apache.org with SMTP; 3 Feb 2003 16:06:26 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: how to update TurbineUser instance Date: Mon, 3 Feb 2003 10:05:49 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: how to update TurbineUser instance Thread-Index: AcLLXvv5JBYWyOEnS066qlv3IQ3HbAAPz6vg From: "Quinton McCombs" To: "Turbine Users List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Sorry, I think it is store() > -----Original Message----- > From: Marc Lustig [mailto:mail@marclustig.com]=20 > Sent: Monday, February 03, 2003 2:34 AM > To: Turbine Users List > Subject: AW: how to update TurbineUser instance >=20 >=20 > Thanks Quinton, but DBUserManager does not have a save()=20 > method. Did you refer to the proposal code included in Fulcrum? >=20 >=20 > > -----Ursprungliche Nachricht----- > > Von: Quinton McCombs [mailto:qmccombs@nequalsone.com] > > Gesendet: Montag, 3. Februar 2003 05:10 > > An: 'Turbine Users List' > > Betreff: RE: how to update TurbineUser instance > >=20 > >=20 > > Here one thing that _might_ work as a hacked solution for=20 > you. I have=20 > > not tried this but it seems like it should work.... > >=20 > > TurbineUser.save() users the security service to save=20 > itself. In the=20 > > logic of the save there is a call to > > TurbineSecurity.accountExists(username) (or something like=20 > that). If=20 > > the account exists(by comparin username), it performs an update.=20 > > Otherwise it does an insert. > >=20 > > Here is the workaround: > > Override the save method in your extended user class. In=20 > the body of=20 > > this method put the code from DBUsermanager.save(). You=20 > will need to=20 > > replace the if(TurbineSecurity.accountExists(user) with=20 > user.isNew(). > >=20 > >=20 > >=20 > >=20 > > > -----Original Message----- > > > From: Johnny Quazar [mailto:quazar@bitblaster.com] > > > Sent: Saturday, February 01, 2003 12:09 PM > > > To: Turbine Users List > > > Subject: Re: how to update TurbineUser instance > > >=20 > > >=20 > > > Hey Marc,x > > >=20 > > > Try this once? > > >=20 > > > client.setUserName(x); > > > client.setModified(true); > > > client.setNew(false); > > > client.save(); > > >=20 > > > Seems to work here (but I'm not changing userName). Oops I see=20 > > > Quinton's response now and he sounds like this might be=20 > understood.=20 > > > Guess I'll click send anyway since this is drafted. > > >=20 > > >=20 > > > At 11:28 PM +0100 1/31/03, Marc Lustig wrote: > > > >I've got a form that should allow the user to change his > > > username. Now > > > >I'm running into trouble trying to update the corresponding user=20 > > > >instance. > > > > > > > >(Note, I have extended TurbineUser: > > > >public abstract class BaseAudiotexUser extends=20 > > > >de.geoconnect.audiotex.om.TurbineUserAdapter > > > >public class TurbineUserAdapter extends TurbineUser > > > >This implementation works pretty good so far and I don't=20 > think it=20 > > > >is > > > >related to that problem here.) > > > > > > > >This code > > > > > > > >AudiotexUser client =3D .. > > > >client.setUserName(x); > > > >client.save(); > > > > > > > >results in that exception: > > > > > > > >Caused by: org.apache.turbine.util.security.DataBackendException: > > > >Failed to create account 'dd': Invalid argument value: > > > Duplicate entry > > > >'1040' for key 1 > > > > > > > >Apparently torque is trying to make an insert instead of=20 > an update. > > >=20 > > >=20 > > >=20 > -------------------------------------------------------------------- > > > - > > > To unsubscribe, e-mail:=20 > turbine-user-unsubscribe@jakarta.apache.org > > > For additional commands, e-mail:=20 > turbine-user-help@jakarta.apache.org > > >=20 > > >=20 > >=20 > >=20 > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail:=20 > turbine-user-help@jakarta.apache.org > >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: turbine-user-help@jakarta.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org