Issue
Customer_account import is getting lot of error when inserting a new record example - java.sql.BatchUpdateException: Duplicate entry for key account_path
Cause
Not updating the sys property (com.snc.cs_base.last.generated.code.tree.path) with correct value after importing the customer_account data
Records already exist with the provided value in the sys property (do a query on account_code with that value) Refer : Create customer and consumer information
The value in sys property (com.snc.cs_base.last.generated.code.tree.path) went out of sync with the records in customer_account
Resolution
Workaround/solution would be :
- Update the com.snc.cs_base.last.generated.code.tree.path sys_property with the correct value
- You can get the value by sorting the record list in descending order based on account_code and the first record will be the one with higher lexical order
- So, To get the latest code that is generated :
- Go to accounts
- Add Account Code field in the list view
- Sort the list in descending order based on "Account Code" Field
- The account code of the first record is the last generated code
* More Details :
* How new account code gets generated - account_code is generated based on the pattern "!#$&()*+,-.0123456789:;<?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]`}|{~" and sys_property com.snc.cs_base.last.generated.code.tree.path
For e.g.: if value in sys_property is !!!#, the next value for account code will be !!!$.