3 ms·
When you manipulate the state of something (e.g. database or memory), then in a transactional system you have to specify in which transaction the change is supp
by amelius 9y ago
When you manipulate the state of something (e.g. database or memory), then in a transactional system you have to specify in which transaction the change is supposed to occur.
So besides commit and rollback, a transaction has a "change" method, if you'd like to look at it that way. The change method is what makes transactions useful.
And the API function is indeed supposed to call only "change", not "commit" or "rollback".
- chopin 9y agohttps://docs.oracle.com/javaee/6/api/javax/persistence/EntityTransaction.html https://docs.oracle.com/javaee/6/api/javax/persistence/Entit... doesn't have this. Could you point to a transaction (preferably in Java) which permits a "change"?
- sk5t 9y agoI am also baffled as to what this "change" operation is meant to suggest. Enlisting possibly-unrelated operations in a common transaction is a good tool to have in the toolbox, although it is a tad hairy to bake that into each method signature. Spring's TransactionTemplate presents an alternate approach.