Article - CS348079

"Could not create a transaction for ThingworxPersistenceProvider" is seen on subsequent queries after calling DeleteStreamEntry with a non-existent streamEntryId in ThingWorx Platform

Modified: 13-Mar-2025   


Applies To

  • ThingWorx Platform 8.5 to 9.5

Description

  • Queries are suddenly failing after calling DeleteStreamEntry with a Stream Entry ID value that did not exist in ThingWorx Platform
  • Getting Could not create a transaction for ThingworxPersistenceProvider when calling DeleteStreamEntry with an non-existent streamEntryId in a custom service
  • When calling DeleteStreamEntry with an non-existent streamEntryId subsequent queries fail with the following error
Error executing service <service_name>. Message :: Could not create a transaction for ThingworxPersistenceProvider - See Script Error Log for more details.
  • ​​The following Service code fails when calling QueryStreamEntriesWithData if the streamEntryID specified in DeleteStreamEntry does not exist:
Things["StreamTest"].DeleteStreamEntry({
	streamEntryId: "<Non-existent ID>"
});

var result =  Things["StreamTest"].QueryStreamEntriesWithData({
	oldestFirst: undefined /* BOOLEAN */,
	maxItems: undefined /* NUMBER */,
	sourceTags: undefined /* TAGS */,
	endDate: undefined /* DATETIME */,
	query: undefined /* QUERY */,
	source: undefined /* STRING */,
	startDate: undefined /* DATETIME */,
	tags: undefined /* TAGS */
});
This is a printer-friendly version of Article 348079 and may be out of date. For the latest version click CS348079