Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Release Branch 10.04
-
None
-
None
-
Bug Crush Event - 21/2/2015
Description
Sending more than one email at once to a party that never has received an email using the sendMailFromScreen service fails.
Creating the communication event for the email in this case triggers the createPartyRole service. So two threads apparently try to insert the same party role. This results in the following error:
java.lang.Exception: Failure in create operation for entity [PartyRole]: org.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:PartyRole][createdStamp,2010-08-30 10:44:41.144(java.sql.Timestamp)][createdTxStamp,2010-08-30 10:44:26.709(java.sql.Timestamp)][lastUpdatedStamp,2010-08-30 10:44:41.144(java.sql.Timestamp)][lastUpdatedTxStamp,2010-08-30 10:44:26.709(java.sql.Timestamp)][partyId,RegisteredMerchantCompany(java.lang.String)][roleTypeId,ADDRESSEE(java.lang.String)] (SQL Exception while executing the following:INSERT INTO ofbiz.PARTY_ROLE (PARTY_ID, ROLE_TYPE_ID, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?) (ERROR: duplicate key value violates unique constraint »pk_party_role«)). Rolling back transaction.
This happens only after the actual emails are sent. OFBiz now rolls back the transaction, thinks the email sending failed, and tries to send the emails again later.
Workaround:
Create a PartyRole ADDRESSE for the party before trying to send emails.
We did not find a good solution for the actual problem.
Attachments
Issue Links
- is related to
-
OFBIZ-5853 The createPartyRole service does not check a duplicate key.
- Closed