Return-Path: Delivered-To: apmail-jakarta-turbine-user-archive@apache.org Received: (qmail 31413 invoked from network); 3 Feb 2003 08:34:15 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 3 Feb 2003 08:34:15 -0000 Received: (qmail 3631 invoked by uid 97); 3 Feb 2003 08:35:54 -0000 Delivered-To: qmlist-jakarta-archive-turbine-user@nagoya.betaversion.org Received: (qmail 3624 invoked from network); 3 Feb 2003 08:35:54 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 3 Feb 2003 08:35:54 -0000 Received: (qmail 29581 invoked by uid 500); 3 Feb 2003 08:33:54 -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 29539 invoked from network); 3 Feb 2003 08:33:53 -0000 Received: from moutng.kundenserver.de (212.227.126.188) by daedalus.apache.org with SMTP; 3 Feb 2003 08:33:53 -0000 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 18fc3J-00054w-00 for turbine-user@jakarta.apache.org; Mon, 03 Feb 2003 09:34:05 +0100 Received: from [217.230.238.214] (helo=lustig) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 18fc3J-0006QU-00 for turbine-user@jakarta.apache.org; Mon, 03 Feb 2003 09:34:05 +0100 From: "Marc Lustig" To: "Turbine Users List" Subject: AW: how to update TurbineUser instance Date: Mon, 3 Feb 2003 09:34:03 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal In-reply-to: <001001c2cb3a$11bf5a10$020a0a0a@blaze> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks Quinton, but DBUserManager does not have a save() method. Did you refer to the proposal code included in Fulcrum? > -----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 > > > Here one thing that _might_ work as a hacked solution for you. I have > not tried this but it seems like it should work.... > > TurbineUser.save() users the security service to save itself. In the > logic of the save there is a call to > TurbineSecurity.accountExists(username) (or something like that). If > the account exists(by comparin username), it performs an update. > Otherwise it does an insert. > > Here is the workaround: > Override the save method in your extended user class. In the body of > this method put the code from DBUsermanager.save(). You will need to > replace the if(TurbineSecurity.accountExists(user) with user.isNew(). > > > > > > -----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 > > > > > > Hey Marc,x > > > > Try this once? > > > > client.setUserName(x); > > client.setModified(true); > > client.setNew(false); > > client.save(); > > > > Seems to work here (but I'm not changing userName). Oops I see > > Quinton's response now and he sounds like this might be understood. > > Guess I'll click send anyway since this is drafted. > > > > > > 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 > > >instance. > > > > > >(Note, I have extended TurbineUser: > > >public abstract class BaseAudiotexUser extends > > >de.geoconnect.audiotex.om.TurbineUserAdapter > > >public class TurbineUserAdapter extends TurbineUser > > >This implementation works pretty good so far and I don't think it is > > >related to that problem here.) > > > > > >This code > > > > > >AudiotexUser client = .. > > >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 an update. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: turbine-user-help@jakarta.apache.org > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: turbine-user-help@jakarta.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: turbine-user-help@jakarta.apache.org