The message indicates that you performed some local transaction work as part of that containment scope but did not commit. I suggest two options:
1) Commit the local transaction
connection.commit();
2) Putdata source to auto-commit
connection.setAutoCommit(true);