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. 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. >> >> > <snip> > >> 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) >> > <snip> >> 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#a6345818 Sent from the Apache Geronimo - Users forum at Nabble.com.
