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;
   }

Reply via email to