Hi Surendra,

Thank you for explaining the problem again, I can now figure out that we have a problem within JOnAS in some particular cases when the database is accessed concurrently from outside the EJB server (or from another EJB server).
The fact is that JOnAS effectively caches the objects. If you update a record from outside the server, there would be no problem if the correct isolation level is set and EJB server transactions are used, because the object will be stored at the end of each transaction and loaded at the beginning of each transaction.
But in your case, you delete the record from outside the server, and the object is still cached within JOnAS ! If you just access (find...) the object, you will get an exception (because the object will not be found by the ejbLoad method when refreshing the state), which is a correct behaviour, but if you want to create a new instance with the same key, the EJB server will find the object in its cache and will not check if it is still in the database (which is a bug if we intend to allow access to the database from outside the server), and it will raise the DuplicateKey exception.
Thus I think we have a buggy behaviour here, however we have only few experience with multi-servers access to the same database, and we have to study the problem in more details to be able to provide an adequate fix.

I will keep you informed.

Best Regards,

François

PS: in the meantime, the only solution I see would be to delete the record from the EJB server ...

Surendra wrote:

 I have checked the Isolation level it is properly set toTRANSACTION_SERIALIZABLE but the problem still remain the same.Let me explain the problem again, i have inserted a record withid say 101 and deleted the same record with Oracle client outsidethe EJBWorld now when i again trying to insert the record with id 101i am getting javax.ejb.DuplicateKey error as per my knowledge databaseis rendering properly, isolation level is set but EJBServer iscaching the record that's why i am getting this error.Since i know that one of my table will be modified outside the EJBworldIs there any way thru which i can avoid caching of a particular table or anysolution to overcome this error? RegardsSurendra
--
==================================================================
Francois EXERTIER         Evidian (Groupe Bull)
     1, rue de Provence,  BP 208,  38432 Echirolles cedex, FRANCE
     mailto:[EMAIL PROTECTED]
     http://www.evidian.com/jonas   http://www.objectweb.org/jonas
     Tel: +33 (0)4 76 29 71 51  -  Fax:   +33 (0)4 76 29 77 30
==================================================================
  ---- To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "unsubscribe jonas-users". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to