TheServerSide.com has some good pattern discussions with regards to EJBs. 

Check out http://theserverside.com/patterns/index.jsp

In particular the discussion on a Entity Bean Primary Key Generator pattern

http://theserverside.com/patterns/thread.jsp?thread_id=220

The outcome of this can be found at

http://theserverside.com/discussion/thread.jsp?thread_id=1995

Which also has links to code.

Cheers

Jonathan

-----Original Message-----
From: Luke Taylor [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 18 January 2001 8:17 a.m.
To: jBoss
Subject: Re: [jBoss-User] Entity CMP



Isn't it rather risky using MAX to obtain the next primary key, as
there could be multiple threads creating new entities, and two or more
of them could obtain the same value for MAX and attempt to use the same
primary key? The best way I'm aware of is to use a DB sequence, but
this involves proprietary SQL. I'd be interested in any better
suggestions too.

Luke.


-- 
 Luke Taylor.
 PGP Key ID: 0x57E9523C


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to