Prevent org.postgresql.util.PSQLException: Cannot change transaction read-only property in the middle of a transaction from close connection

when release connection to pool,bonecp will call setReadonly on connection,if there is a transaction and is not ended,postgresql will throw exception.
org.postgresql.util.PSQLException: Cannot change transaction read-only property in the middle of a transaction

the resolution is try rollback to end transaction on the reuse connection