Weitere Kapitel dieses Buchs durch Wischen aufrufen
Let’s say that a buyer logs in to the bookshop application and purchases a book. The following actions should take place in the event of a purchase:
Bitte loggen Sie sich ein, um Zugang zu diesem Inhalt zu erhalten
Sie möchten Zugang zu diesem Inhalt erhalten? Dann informieren Sie sich jetzt über unsere Produkte:
Pay attention to this term—it shows up a lot.
This is not to imply that the Apache Commons-DBCP is not well-known, robust, or well-supported; it’s just that to Your Author, c3p0 is well-knownier, robuster, and well-supporteder. In other words, it is purely personal preference, and either library would work, although they’re configured differently.
We told you that you’d see the term “transaction demarcation” again!
Then again, you may not feel the need to execute rollback() in a try/catch block. There’s not much you can do if a rollback fails; it is probably one of those cases where you want to see a catastrophic failure so you can find out what went horribly, horribly wrong, as opposed to trying to recover. You see the same philosophy in motion when the openSession() call is not in a try/catch block; if I can’t open a Session, there’s no point in recovery. I want to fix that problem.
The technical reviewer (correctly) pointed out that JTA is an API, not an implementation, and it doesn’t actually provide transactions—only a way to manage them. If you use JTA in an environment outside of an application server, for example, you have to provide a JTA implementation as well.
- Transactions and Concurrency
- Chapter 13
Neuer Inhalt/© ITandMEDIA