Richard:

As a vendor, I can tell you it may not happen.

Here is why:  The application server may wait until it attempts to put the
row in the database before it will throw any kind of error.  If it doesn't
try to do this right away, then you will have two separate entity objects
that exist simultaneously.  But, whenever the insert takes place, one will
fail.

BUT... in order to make sure of this, have the DB defend against having
multiple primary keys at the same time.  If the database allows duplicate
PK's, the application server may assume your case is legal, and do nothing.

The reasons behind this are complex, but in our case it is because of our
cluster support.  There is really no way for a cluster to defend against
multiple 'duplicate' objects being created.  The best place to do that is at
the 'hub', or the database.  (Can you imagine the network traffic if this
was done another way?)


Jonathan




Richard Martin wrote:
>
> I know this is a dunce question but my brain has fallen out.
>
> I have two threads calling ejbCreate on the same entity at the same time and both 
>are succeeding. Shouldn't the App Server defend against this case? How can I fix this?
>
> ==============================================================================
> This email and any files transmitted with it are confidential and intended solely 
>for the use of the individual or entity to whom they are addressed. All information 
>is the view of the individual and not necessarily the company. If you are not the 
>intended recipient you are hereby notified that any dissemination, distribution, or 
>copying of this communication and its attachments is strictly prohibited. If you have 
>received this email in error please notify:
> [EMAIL PROTECTED]
>
> ==============================================================================
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
Jonathan Baker

Senior Architect
eBusiness Division
Sybase, Inc.

[EMAIL PROTECTED]
+1 301 896 1363

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to