• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Transactions not committing in a threaded application

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I have an application with multiple threads, each reading different data(possibly from the same rows) from the same table, and makes changes based on data pulled from other pertinent rows in the table. Each thread has its own @Transaction annotation and according to the log, they are all getting their own transaction. The app pulls all data, logs changes to be made, makes the changes to the JPA object etc. fine but the program never persists any of the changes made back to the table.

All my research has led me to believe this should be working.


The flow for my program according to the log file seems to be that each thread gets a transaction, gets an EntityManager, pulls the data, closes the EM, and as they are processing(getting the other pertinent data), getting new EM's for each data pull.



This program was working before I threaded it as it was taking far too long as a single thread application.

I know I haven't given a lot of information out because I don't want to scare anyone away...

I will answer/provide info for any questions.

Thanks in advance for any help!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic