Sometimes (almost randomly) DML statement running in a valid transaction context may fail with "invalid transaction handle" error. All subsequent usage of the same transaction handle (including attempt to rollback) raise the same error. The issue manifests itself only when user-defined temporary blobs are involved in DML operations.
Basically the problem was manifested in PHP with pconnect and write blobs. In normal operation, the error appeared rarely and we could not understand why.
Mini test example no.
For playback, I connected the database DY and he caught the error.