IntelliJ Java IDE
The moose likes Spring and the fly likes Transactions not committing in a threaded application Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Transactions not committing in a threaded application" Watch "Transactions not committing in a threaded application" New topic
Author

Transactions not committing in a threaded application

Nickolas Case
Ranch Hand

Joined: Apr 26, 2008
Posts: 96
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!
 
 
subject: Transactions not committing in a threaded application
 
Threads others viewed
Few Question About Threads
Regarding JTable Sorting
Trouble with model for calculating and adding table values dependent on multiple rows
Compiling Java to Native Code
Problem in updating/deleting data from MS Access Database
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture