Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

TransactionAttribute - what's the right setting

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a process sometimes creates an email showing all zeros in the stats even though that's not truly what's on the database.

The process works like this
1. User selects a spreadsheet.
2. User hits the button to start the load/calculations and that timestamp is captured. (start_tsp)
3. Load occurs
4. Calculations occur
5. Timestamp is captured (end_tsp)
6. Email details are compiled by querying the tables loaded. Criteria for those queries is the user's lid and maint timestamp between the start_tsp and end_tsp)
7. Email is sent

Everything works fine most of the time, but occasionally, the queries from step 6 return nothing.
I added logging to verify the queries have the correct lid and timestamps. Running the same query in SQL Nav afterwards shows rows for the lid between the timestamps.
This has happened only in our Production environment. We can't recreate it in Test or even make it happen consistantly in Prod. (We've had the user reload the same spreadsheet after getting the 0's and it'll work the second time.)

One of our tech guys suggested that the TransactionAttribute could be the problem. Here's how that's set:

* Session Bean implementation class NTBServiceImpl Must be marked not supported
* so that it does not timeout
public class NtbServiceImpl implements NtbService {

He's recommending it be changed to REQUIRED or REQUIRES_NEW. But, note that the comment is saying it's set to NOT_SUPPORTED so it won't timeout. Tech guy isn't sure what will happen then.
This process takes 1-2 minutes real time so timeout is a possibility.

Should I change the attribute? If so, to what?

Thanks for the help.

PS. I'm new to this transaction stuff, so please explain in '... for dummies' language.
Posts: 543
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JBoss, you can use the @TransactionTimeout annotation... If not, check your server documentation to change the Transaction Timeout on that specific method, or in general.

But not using a transaction to circumvent the timeout is not a good practice.
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic