cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate entries created in the PaymentTransaction table with the same time stamp

Former Member
0 Kudos
165

Hello Guys,

As part of our payment solution, we are creating a new instance of the payment transaction model with the cart ID and the transaction Id during the initial handshake b/w Hybris and the payment provider to render the iframe for the Customer to key in the card details.

I'm left with a weird issue in our test env which uses mysql DB where there are two entries(with same cart ID and the transaction Id) created in the payment transaction model with the same time stamp. Please note that we are checking the DB to see if an entry exists in the payment transaction table with the given card ID and transaction ID before creating a new instance.

Also FYI, in the current state there are no unique constraints enforced against any of the attributes in the payment transaction item type.

P.S : This issue is not found in my dev machine which runs on HSQLDB.

Code snippet :

if(null == getPaymentReferencfromDB(cart, transactionID){ PaymentTransactionModel transaction = (PaymentTransactionModel) this.modelService .create(PaymentTransactionModel.class); transaction.setMerchantReference(merchreference); transaction.setCode(result.getRequestTransactionID()); modelService.save(transaction); modelService.refresh(transaction); modelService.detachAll(); }

Any advise on this would be helpful.

Thanks. Suresh

Accepted Solutions (0)

Answers (0)