I have some more details on this
(the last number in a row is system time in millisecs):
[INFO] ProductManager findByPrimaryKey: [.113.2213167.2211399.] - 5981330 - 1046460849825
[INFO] ProductManager findByPrimaryKey: [.113.2213167.2211399.] - 6992616 - 1046460849835
[INFO] Product ejbCreate START: [.113.2213167.2211399.] - 1888960 - 1046460849885
[INFO] Product ejbCreate END: [.113.2213167.2211399.] - 1888960 - 1046460849895
[INFO] ProductManager: New product instance created: [.113.2213167.2211399.]
[INFO] Product ejbCreate START: [.113.2213167.2211399.] - 3602759 - 1046460849965
[INFO] Product ejbCreate END: [.113.2213167.2211399.] - 3602759 - 1046460849965
[ERROR,ProductManager] TRANSACTION ROLLBACK EXCEPTION:
javax.transaction.TransactionRolledbackException: Could not create product instance: javax.ejb.DuplicateKeyException: En
tity with key [.113.2213167.2211399.] already exists; nested exception is:
Obviously, findByPrimaryKey() is called by two different session bean instances (ProductManager);
and the first create() is started after this sequence. The second create() is called after the
first has finished since session instance #2 still assumes non-existence of this product.
Sooo..., is there an efficient (off-spec ) jboss-internal hack, that enables the second (or any subsequent) call to ejbCreate() to return the valid instance instead of throwing an exception?
Any ideas welcome,
Lars