Note: for pre-3.3 releases there is an issue with DB2 related to a bug in the DB2 drivers: https://issues.apache.org/jira/browse/DERBY-246 - this is yet to be confirmed.
A possible workaround (if you use Hibernate) is the configure connection release mode to after transaction - see Hibernate Integration