How can I validate that all JDBC access happens on an active transaction, i.e. java.sql.Connection.getAutoCommit()
always return false?
I'm using Spring for transaction management ( @Transactional
) and Hibernate for data access.
Update: What happens is that some Hibernate access is performed without the service method being annotated with @Transactional
. That's what I want to be notified of.
Update 2: Code sample
It's possible to call the following code:
public ServiceImpl implements Service {
// missing @Transactional
public List<String> getSomeIds() {
return getDao().getSomeIds();
}
}