Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is Transaction only for database  RSS feed

 
Karthik Vijayarajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been developing J2EE applications for sometime now and i have always used transactions for some series of operations on a database. I was curious to find out if transactions are meant only for databases or one can use them to make changes to an object state and then decide whether to commit or rollback the changes to the object state as necessary.

Thanks !!
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly, transactions aren't just for databases, but can also be just in-memory stuff, or other backend resources. Hence why you see transaction levels on ejb methods, cache regions is caching data from the database on the server, and on the database, and on, and on.

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And where have you been? What are you doing now?

Mark
 
Karthik Vijayarajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for enlightenment Mark !! :-)
Yeah.quite a long break !!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!