Commit in separated thread doesn't close transaction. The best solution would be move it into manage commands.