Support Article
BadTableMappingException while committing data in database
Summary
BadTableMappingException while committing data in the database using the out-of-the-box pyDeleteAttachment rule.
Error Messages
com.pega.pegarules.pub.database.BadTableMappingException: Database-General
Cannot write property pxLatitude to a decimal column--its value, "NaN", is not a decimal
at com.pega.pegarules.data.internal.access.PageDatabaseMapperImpl.setStmtInsert(PageDatabaseMapperImpl.java:2094)
at com.pega.pegarules.data.internal.access.PageDatabaseMapperImpl.fillInSaveStatementWithoutStream(PageDatabaseMapperImpl.java:1552)
at com.pega.pegarules.data.internal.access.Saver.getStatementWithPrepValues(Saver.java:1612)
at com.pega.pegarules.data.internal.access.Saver.addBatch(Saver.java:993)
at com.pega.pegarules.data.internal.access.Saver.saveInstance(Saver.java:888)
at com.pega.pegarules.data.internal.access.Saver.saveInstance(Saver.java:803)
at com.pega.pegarules.data.internal.access.UpdateProcessor.performOps(UpdateProcessor.java:1392)
at com.pega.pegarules.data.internal.access.UpdateProcessor.action(UpdateProcessor.java:245)
at com.pega.pegarules.data.internal.access.UpdateProcessor.action(UpdateProcessor.java:82)
at com.pega.pegarules.data.internal.store.DataStoreManager.doInTransaction(DataStoreManager.java:235)
at com.pega.pegarules.data.internal.access.UpdateProcessor.processUpdates(UpdateProcessor.java:178)
at com.pega.pegarules.data.internal.access.DatabaseImpl.commit(DatabaseImpl.java:2066)
at com.pegarules.generated.activity.ra_action_deleteattachment_d26bc4a01bce6c20d98292ac204cee80.step21_circum0(ra_action_deleteattachment_d26bc4a01bce6c20d98292ac204cee80.java:1607)
Steps to Reproduce
- Log in to the application
- Delete an attachment
- Commit data to the database using the pyDeleteAttachment rule
Root Cause
The pyGeolocationTrackingIsEnabled in @baseclass is set to false. However, the When rules from the Customer Service classes was set to true. If the When rule is set to true and there are no values in the latitude and longitude properties while writing to the database, errors occur.
Resolution
Perform the following local-change:
Create the pyGeolocationTrackingIsEnabled When rule in the concerned case type class and set it to false.
Published December 30, 2019 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.