Advertisement
Guest User

Untitled

a guest
Oct 19th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  2. <property name="entityManagerFactory" ref="entityManagerFactory" />
  3. <property name="defaultTimeout" value="400" />
  4. </bean>
  5.  
  6. int timeout = determineTimeout(definition);
  7. if (timeout != -1) {
  8. txObject.getConnectionHolder().setTimeoutInSeconds(timeout);
  9. }
  10.  
  11.  
  12. public void setTimeoutInSeconds(int seconds) {
  13. setTimeoutInMillis(seconds * 1000);
  14. public void setTimeoutInMillis(long millis) {
  15. this.deadline = new Date(System.currentTimeMillis() + millis);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement