java - How can i attach data to a JTA transaction? (or uniquely identify it) -


I have a getStockQuote () function that will get an existing stock quote for a symbol from the stock market.

My goal is that within the JTDA transaction, the first call to get GetStockQuote () will bring a stock quote, but each call coming within the same transaction will be re-sold to the same stock quote. Will be used (example: it will not try to bring a new quote). If a separate transaction starts, or another transaction runs concurrently, then I hope that the second transaction will have to get its stock quote on its first call.

This is an attempt to ensure continuity within the transaction - so that all the calculations within the transaction are based on the same stock price.

This you use the CAA value for the JPA provider to obtain a database line from the database only, and access after the same database line within the transaction.

How can anyone get tips on this?

This will require some testing but I think you can tie the quotation and your beans You can apply to share. Excerpt from Threadlocal after the commitment of a transaction (and after applying a transaction-scaled reference like this).


Comments