I am doing something similar to this except that I am directly getting the
sequence.nextval in the ejbCreate (rather than using a trigger) and setting
my primary key data field in the bean to this value:

ejbCreate ... {
    this.id = // get next value from sequence
}

This seems to work great.

Ian.
----- Original Message -----
From: "danch" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 05, 2001 5:13 PM
Subject: Re: [JBoss-user] Oracle Trigger Problem


> What do you return from ejbCreate? this should be an instance of your
> primary key class, but if you generate the key value based on a trigger,
> i don't see how you can do this.
>
> -danch
>
> > Creighton Kirkendall wrote:
> >
> > I have a table that has a primary key. I have setup a trigger to
> > auto-increment with a sequence in oracle. When I call my ejb-create
> > method everything seem to work fine.  The record is inserted.  However
> > if I then try to call the getPrimaryID() method (this is the primary
> > key an int) it returns 0 no matter what.  And if I try to set any
> > field it looks like it works however nothing is actually changed in
> > the database.  I hope someone out there can help me.
> >
> >
> > Creighton Kirkendall
> Confidential e-mail for addressee only.  Access to this e-mail by anyone
else is unauthorized.
> If you have received this message in error, please notify the sender
immediately by reply e-mail
> and destroy the original communication.
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to