Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 62874 invoked from network); 17 Sep 2006 06:39:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Sep 2006 06:39:51 -0000 Received: (qmail 7174 invoked by uid 500); 17 Sep 2006 06:39:49 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 7153 invoked by uid 500); 17 Sep 2006 06:39:49 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 7141 invoked by uid 99); 17 Sep 2006 06:39:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Sep 2006 23:39:49 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Sep 2006 23:39:48 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1GOqJL-0003l5-SS for user@geronimo.apache.org; Sat, 16 Sep 2006 23:39:27 -0700 Message-ID: <6346879.post@talk.nabble.com> Date: Sat, 16 Sep 2006 23:39:27 -0700 (PDT) From: Brandon Dooley To: user@geronimo.apache.org Subject: Re: CMP Setter & ejbCreate In-Reply-To: <6345818.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: brandon@rootedlabs.com References: <6342963.post@talk.nabble.com> <6345818.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I began to dig around, and there really isnt any documentation besides http://publib.boulder.ibm.com/wasce/V1.0.1.0/en/Reference/Plans/openejb-pkgen-2.0.xsd.html#h1577217937 this place . I altered openejb-jar.xml where I think the key-generator config goes but its not totally right but I think its close. I've got no other leads. Suggestions? [...] [...] eventid [...] Brandon Dooley wrote: > > Hi Gianny, > > Thanks for the response, it sounds like I could use an explanation on > providing a primary-key generator. The primary key is an auto_increment > bigint column in a mysql database and I was not setting it, I thought > mysql would handle it. Thanks again for your help. > > Brandon > > > Gianny Damour wrote: >> >> Hi Brandon, >> >> I suspect that the primary key is null after the execution of >> ejbCreate. Are you sure that you are setting it during ejbCreate? If >> you want this id to be generated, then you will need to provide a >> primary-key generator for this CMP. I can explain you how to do that, >> if need be. >> >> Thanks, >> Gianny >> >> On 17/09/2006, at 5:07 AM, Brandon Dooley wrote: >> >>> >>> I'm getting this exception when I try and create a new bean that >>> has setter. >>> I did find Aaron's post >>> http://www.nabble.com/CMR-Setters---ejbCreate-tf407940.html#a1122043 >>> http://www.nabble.com/CMR-Setters---ejbCreate- >>> tf407940.html#a1122043 but >>> his was a slightly different error and I'm using CMP Beans not CMR >>> Beans. >>> >>> >> >> >>> Caused by: java.lang.IllegalStateException: Identity not available >>> at org.tranql.cache.CacheRow.getId(CacheRow.java:163) >>> at org.tranql.cache.InTxCache.associate(InTxCache.java:43) >>> at org.tranql.cache.CacheTable.addRow(CacheTable.java:92) >>> at >>> org.openejb.entity.cmp.CMPCreateMethod.execute(CMPCreateMethod.java: >>> 195) >>> at >>> org.openejb.dispatch.DispatchInterceptor.invoke >>> (DispatchInterceptor.java:72) >>> >> >>> public java.lang.Long ejbCreate(String title, String >>> description, String >>> location, >>> Integer typeId, String url, String type, String creator) throws >>> javax.ejb.CreateException { >>> setTitle(title); >>> setDescription(description); >>> setLocation(location); >>> setTypeid(typeId); >>> setType(type); >>> setUrl(url); >>> setCreator(creator); >>> return null; >>> } >> >> >> > > -- View this message in context: http://www.nabble.com/CMP-Setter---ejbCreate-tf2283342.html#a6346879 Sent from the Apache Geronimo - Users forum at Nabble.com.