Article - CS363778

"Transaction is in failure state" is seen repeatedly when executing custom Service/Subscription code in ThingWorx Platform

Modified: 13-Mar-2025   


Applies To

  • ThingWorx Platform 8.5 to 9.3

Description

  • Specific database transaction is failing and will not proceed
  • Execution of custom code fails with error 'Could not create a transaction for ThingworxPersistenceProvider' and 'Transaction is in failure state'
  • Custom code which interacts with the database which was previously working is now showing 'Could not create a transaction for <Persistence Provider Name>'
  • Error messages in the ThingWorx logs:
    • ApplicationLog.log
      • [L: ERROR] [O: c.t.p.p.PostgresModelExceptionTranslator] [I: ] [U: Administrator] [S: ] [P: ] [T: TWEventProcessor-7] [1,018] Data store unknown error: [Error occurred while accessing the model provider.]
    • ErrorLog.log (with Enable Stack Tracing enabled in the LoggingSubsystem)
      • [L: ERROR] [O: E.c.t.p.p.PostgresModelExceptionTranslator] [I: ] [U: Administrator] [S: ] [P: ] [T: TWEventProcessor-15] Could not create a transaction for ThingworxPersistenceProvider
        [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: Administrator] [S: ] [P: ] [T: TWEventProcessor-15] [1,018] Data store unknown error: [Error occurred while accessing the model provider.] java.lang.Exception: Transaction is in failure state.
            at com.thingworx.persistence.PersistenceProviderTransactionManager.getOrCreateTransaction(PersistenceProviderTransactionManager.java:55)
            ...
        Wrapped by: java.lang.Exception: Could not create a transaction for ThingworxPersistenceProvider
            at com.thingworx.persistence.PersistenceProviderTransactionManager.getOrCreateTransaction(PersistenceProviderTransactionManager.java:81)
            at com.thingworx.persistence.PersistenceProviderTransactionManager.getModelProviderTransaction(PersistenceProviderTransactionManager.java:188)
            at com.thingworx.persistence.TransactionFactory.getModelProviderTransaction(TransactionFactory.java:71)
            ...
        Wrapped by: com.thingworx.common.exceptions.ModelAccessException: [1,018] Data store unknown error: [Error occurred while accessing the model provider.]
            at com.thingworx.persistence.postgres.PostgresModelExceptionTranslator.rethrowTranslated(PostgresModelExceptionTranslator.java:31)
            at com.thingworx.persistence.postgres.PostgresModelSearchProvider.searchModel(PostgresModelSearchProvider.java:255)
            at com.thingworx.persistence.search.MultiSearchProvider.searchModel(MultiSearchProvider.java:81)
            ...
This is a printer-friendly version of Article 363778 and may be out of date. For the latest version click CS363778