Jump to content
  • Advertisement
Sign in to follow this  
plywood

EJB, JDO & JTA

This topic is 3798 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I overheard a co-worker saying that Java Transaction API (JTA) is "based on atomic operations." To me, an atomic operation is one which, if it fails, does not bring about the failure of the aggregate system. But I am having a difficult time making the connection to atom. ops & JTA. Furthermore, googling the two phrase conjunctively yields nodda. (1) Can anybody elaborate for me? Also, this triggered another series of thoughts. And so I took some time to look up JDO (persistence), EJB and JTA on Sun's website. All the descriptions are cryptic and seem to be written by people who are already "in the know," but for the life of me I can't figure out how all these technologies are meant to work with each other. (2) How would any arbitrary project, say, the design of a Widget Processor, incorporate EJB, JDO & JTA altogether? thx for any insight, ply

Share this post


Link to post
Share on other sites
Advertisement
Atomic operation either succeeds completely, or doesn't happen at all.

Atoms were defined by greek philosophers as smallest, indivisible matter.

Quote:
if it fails, does not bring about the failure of the aggregate system.


It can bring down everything, as long as it doesn't corrupt the state. A failure in atomic operation on a database may bring the database and the application down, sometimes it's required to - but it must not leave a corrupted state behind.

What you're thinking of would be fault tolerant, or fail-over.

Quote:
Furthermore, googling the two phrase conjunctively yields nodda


First link

Quote:
Also, this triggered another series of thoughts. And so I took some time to look up JDO (persistence), EJB and JTA on Sun's website. All the descriptions are cryptic and seem to be written by people who are already "in the know," but for the life of me I can't figure out how all these technologies are meant to work with each other.


Yes, these are gigantic projects which contain tens of millions of lines of code, and combine just about every RTDBS and concurrency concept in existence. They are designed for very specific needs of very specific domains, so they only apply to "in the know" people.

These topics involve one of the oldest IT topics, and as such have grown so extensive, most developers cannot cope with them, and simply use the above technologies to achieve the requirements of their applications.

Share this post


Link to post
Share on other sites
Antheus,

While I *always* appreciate well-constructed responses to all of my questions, I found your answers to be as cryptic as Sun's documentation!

(1) I now realize my misunderstanding with atomic operations... but I am still missing the connection (if any) to the JTA

(2) Your statement:

Quote:
...and as such have grown so extensive, most developers cannot cope with them, and simply use the above technologies to achieve the requirements of their applications.


This is quite perplexing! I don't even know what the last half of it implies. Are you saying that, basically, since they involve such deep concepts that the average J2EE developer doesn't completely understand what he is working with??

(3) I still can't picture a "synthesis" of EJB, JDO and the JTA all inside of one project. How would a developer use each technology underneath the umbrella of the same program? Would one use JDO to handle permanent object storage, and the JTA to handle the processing of said permanent object from one place to the next....?

Like I said above, I'm not trying to be a nitpicker, just having trouble making sense of your response. ;-)

Share this post


Link to post
Share on other sites
Quote:
Original post by plywood
Antheus,

While I *always* appreciate well-constructed responses to all of my questions, I found your answers to be as cryptic as Sun's documentation!

(1) I now realize my misunderstanding with atomic operations... but I am still missing the connection (if any) to the JTA



a = 2; is usually atomic operation. All bits of 2 will be assigned to 'a'. This is trivial operation, and performed in one CPU cycle, and CPU can guarantee it's atomic (for the sake of argument here, it's not entirely true).

'SELECT * FROM addresses WHERE home = Neverland;' however will take a long time to complete (millions of addresses, some stored on disk, indexes, etc.). It may take minutes, during which time someone else may try to insert something in the database.

Enter Transactions (the T in JTA). The above statement will now execute in one piece, regardless of how long it takes, or who tries to modify the database. This whole operation, taking billions of CPU cycles will act as atomic, same as the trivial statement above.


Quote:
This is quite perplexing! I don't even know what the last half of it implies. Are you saying that, basically, since they involve such deep concepts that the average J2EE developer doesn't completely understand what he is working with??


Yes. J2EE is such huge piece of software, most developers focus on using only small part of its services, which are quite easy to use. The individual details on how to make such applications run reliably, on multiple computers, for thousands of users however are so complex, that engineers built these huge frameworks to assist them.

Think of it as going to McD, and ordering a Big Mac. Do you know exactly how this Big Mac came to be, and how many thousand people are involved, and exactly what each of them does? (fields, growing crops, feeding cattle, the meat processing, logistics delivering the meat, people building refrigerators and stoves, electricity that powers all of it, ........).

You know how to operate the menu. J2EE is equivalent for enterprise-grade applications (50,000 operator centers, multi-continental corporations, etc.).

Quote:
(3) I still can't picture a "synthesis" of EJB, JDO and the JTA all inside of one project. How would a developer use each technology underneath the umbrella of the same program? Would one use JDO to handle permanent object storage, and the JTA to handle the processing of said permanent object from one place to the next....?


This is where code comes into place. Tutorials and others show all of how it's used.

EJB describe objects, and how they behave. Address might be an object, user might be an object, and each of them would have events (user relocated from address A to B).

JTA is the piece responsible for all these things remaining atomic.

JDO basically describes how a Java object (instance/class) translate into RDBMS database (MySQL, Oracle, PostgreSQL).

These cover similar areas, JDO is semi-equivalent to EJB, just different.


There are literally hundreds of frameworks that provide the needs of database applications. The simplest of these are known as CRUD. With advent of large data centers, intranets, and explosion of internet however, many problems arose.

Since most application developers were unable to deliver such applications at market prices (it's not good if customer orders a single item over web, and gets billed 26 times, because the web shop's LAN had a hick-up), these frameworks appeared.

They allow programmers to develop applications trivially as if they were running in simple, reliable and isolated environments, and everything else is taken care of.


The reality however is, many of these frameworks bloated in complexity to that degree that they've become unmaintainable monsters, which require huge teams just to get something working.

other than that, without some experience in developing multi-tier database applications, or basics of relational databases, it's hard to justify the need for such technologies, or explain how they fit together exactly.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!