We are using Spring's JpaTransactionManager for declarative transaction management in a Spring + Hibernate + JPA environment. The connection pooling is done with Apache DBCP.

We need a set a attribute on the underlying connection object. I have a couple of questions:

1. Does JpaTransactionManager use the same underlying Connection during the course of a transaction (with several updates/deletes). i.e. if i set a attribute initially on the connection, I don't have to worry about it in the subsequent updates/deletes.

2. To set the attribute, we need access to the underlying Connection that the transaction manager uses. Is there a smart way to do it (using JpaDialect etc..). Any sample code would be appreciated.

Thanks in advance.