• Post Reply Bookmark Topic Watch Topic
  • New Topic

Transcation implementation.  RSS feed

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have one curious question that has come to my mind many times. We have transactions in EJB , JTA and various other frameworks support transactions usually with commit() and rollback() constructs.

How transactions are actually implemented behind the scenes, I mean what I will have to do if I need to implement my custom transcation handling framework.

Please share any book references , links, URLs that might help.

Thanks.
 
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, how transactions work is typcially governed by the XA transaction architecture and spec. You might want to dig into that area to know more about the ins and outs of transactions and how they are implemented.

Usually though, most developers can go a long way without getting that in depth. I'm actually curious to know what you mean when you talk about implementing your own custom transaction handling framework. In which situations are you not going to be able to access the Java Transaction API, or services of the J2EE container. Basically, I'm wondering what type of evil and tomfoolery you're up to?



-Cameron McKenzie
 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, as per project needs are concerned, I think J2EE APIs meet all the needs.

But I have heard this question coming up many times in discussions / interviews, that if you have to implement your own transaction how will you do it?
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting.

Yeah, in an interview they'd probably want to hear about coordinating the databases, working with the two phase commit, issuing the commit command, and doing rollbacks if anything failed. I can see the academic discussion.

Of course, if I was working with a J2EE app server, and someone asked me to write my own transaction mechanism as opposed to using JTA, I'd look for another contract.

I'd say knowing about the 'two phase commit' is probably at the heart of such a question.

-Cameron McKenzie
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!