Re: xdoclet-user Digest, Vol 13, Issue 6
"John Doe" <[email protected]> Wed, 27 Jun 2007 07:47:24 +0400
| Newsgroups | gmane.comp.java.xdoclet.user |
|---|---|
| Message-ID | <[email protected]> |
Konstantin, what yaour counter bean looks like? Is it just increment the last ID in table or what? On 6/25/07, [email protected] < [email protected]> wrote: > > Send xdoclet-user mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of xdoclet-user digest..." > > > Today's Topics: > > 1. OT: Invitation to participate in research project (Ben Alex) > 2. get new created row Id (John Doe) > 3. Re: get new created row Id (Konstantin Priblouda) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 25 Jun 2007 19:28:02 +1000 > From: Ben Alex <[email protected]> > Subject: [Xdoclet-user] OT: Invitation to participate in research > project > To: [email protected] > Message-ID: <[email protected]> > > Hello there > > I would greatly appreciate a small amount of your time to assist with > my doctoral research at The University of Newcastle. The research > concerns open source licensing and we're seeking developers working on > Java projects. The research is supervised, ethics-approved, anonymous > and results will be freely available. Participation will also provide a > custom licensing report for your project. To learn more, please visit: > > http://licensing-research.newcastle.edu.au > > Thanks for reading this email, and I hope you'll consider participating. > > Best regards > Ben Alex > > (My apologies for being off-topic; this list will not be emailed again) > > > > ------------------------------ > > Message: 2 > Date: Mon, 25 Jun 2007 22:15:06 +0400 > From: "John Doe" <[email protected]> > Subject: [Xdoclet-user] get new created row Id > To: [email protected] > Message-ID: > <[email protected]> > Content-Type: text/plain; charset="koi8-r" > > Hi. I create row in DB through cmp and try to get it's id like this : > Object ref = context.lookup("ContractLocal"); > ContractLocalHome contractLocal = (ContractLocalHome) ref; > ret = contractLocal.create(contract).getId(); > > but I get : > > 2007-06-25 14:44:02,384 ERROR [org.jboss.ejb.plugins.LogInterceptor] > EJBException in method: public abstract java.lang.Integer > com.egar.chronim.server.ejb.SessionFacade.createContract( > com.egar.chronim.model.Contract) throws java.rmi.RemoteException: > javax.ejb.NoSuchObjectLocalException: Entity not found: primaryKey=0 > > but row creates in DB. So I can't get Id through my local interface > because > EJB has id as 0. It does not increment like it does in DB. > How can I get the real ID of new created row? > > > > -- > Best regards, > Bashma?ov Anton > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 3 > Date: Mon, 25 Jun 2007 12:05:23 -0700 (PDT) > From: Konstantin Priblouda <[email protected]> > Subject: Re: [Xdoclet-user] get new created row Id > To: End-user support for the XDoclet code generator > <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=iso-8859-1 > > > --- John Doe <[email protected]> wrote: > > > Hi. I create row in DB through cmp and try to get > > it's id like this : > > Object ref = context.lookup("ContractLocal"); > > ContractLocalHome contractLocal = > > (ContractLocalHome) ref; > > ret = contractLocal.create(contract).getId(); > > > > but I get : > > > > 2007-06-25 14:44:02,384 ERROR > > [org.jboss.ejb.plugins.LogInterceptor] > > EJBException in method: public abstract > > java.lang.Integer > > > com.egar.chronim.server.ejb.SessionFacade.createContract( > > com.egar.chronim.model.Contract) throws > > java.rmi.RemoteException: > > javax.ejb.NoSuchObjectLocalException: Entity not > > found: primaryKey=0 > > > > but row creates in DB. So I can't get Id through my > > local interface because > > EJB has id as 0. It does not increment like it does > > in DB. > > How can I get the real ID of new created row? > > Thanks go to the EJB spec ;) > > Short version is -your fresh and smelly EJB does not > get any ID until it is saved into database. You can > not > control when it saved into database - so you have no > possibility to reliably get ID of freshly created > entity > bean. > Back then in old days I actually used entity beans, > we created counter beans and received sequncial IDs > from there. > ( Looks idiotic - but that's life and standarts ;) ) > Good news is that such counter entity bean is really > transaction oriented and produces good IDs. > > regards, > > > > ----[ Konstantin Pribluda http://www.pribluda.de ]---------------- > JTec quality components: http://www.pribluda.de/projects/ > > > > ____________________________________________________________________________________ > Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user > panel and lay it on us. > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 > > > > > ------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > > ------------------------------ > > _______________________________________________ > xdoclet-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > End of xdoclet-user Digest, Vol 13, Issue 6 > ******************************************* > -- Best regards, Bashmaкov Anton ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ xdoclet-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/xdoclet-user