Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Is it possible to set the transaction timeout at the application level

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using JBoss 7.1.1. on Mac 10.7.5. While I was able to find how to set the transaction timeout on a global basis, is it possible to put some kind of configuration into my WAR file to tell JBoss I want a specific transaction timeout for my application? I'm using Spring 3.1.1.RELEASE and Hibernate 4.1.0.Final.

Thanks, - Dave
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transaction timeout for EJBs? If so, you can do that using @org.jboss.ejb3.annotation.TransactionTimeout on the individual beans.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, no, I'm creating a web application (WAR) and am currently using Spring "@Transactional" annotation to declare which of my service methods (service class is declared with Spring's @Service annotation) I want treated as transactions. Here's how i declare my transaction manager in my spring application context ...



and here's my persistence.xml file ...

 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it looks like you want to set the transaciton timeout controlled by the Spring transaction manager?
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I think so. I tried setting the timeout attribute on the "@Transactional" method of my service class ...



but this doesn't work (I set it to a low value to test it stuff would actually time out, but it didn't).
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So for 20 seconds. And you say a call to that method did not timeout and rollback?

You can also put @Transactional on top of the class and all the public interface methods then all get those settings and is transactional.

Did you also use

<tx:annotation-driven/> in your xml config file?

Mark
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic