You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (Jira)" <ji...@apache.org> on 2019/11/05 05:14:00 UTC
[jira] [Comment Edited] (CAY-2638) Cayennne sends commit
[ https://issues.apache.org/jira/browse/CAY-2638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16967245#comment-16967245 ]
Andrus Adamchik edited comment on CAY-2638 at 11/5/19 5:13 AM:
---------------------------------------------------------------
Actually Cayenne does a "Connection.commit()" after any db operation, including a select, mainly for the reason that contents of some queries are not transparent to the stack and are handled the same way from tx management perspective. IIRC this behavior predates 4.x.
While I've been thinking of changing this at least for obvious selects, this *does not* create an issue for complex TX environments. If you have an external transaction manager, you should simply tell Cayenne to avoid commits (set "cayenne.server.external_tx" property to true. See an example in "Starting Cayenne" chapter - https://cayenne.apache.org/docs/4.0/cayenne-guide/#starting-cayenne )
So this indeed should not be an issue.
was (Author: andrus):
Actually Cayenne does a "Connection.commit()" after any db operation, including a select, mainly for the reason that contents on some queries are not transparent to the stack and are handled the same way from tx management perspective. IIRC this behavior predates 4.x.
While I've been thinking of changing this at least for obvious selects, this *does not* create an issue for complex TX environments. If you have an external transaction manager, you should simply tell Cayenne to avoid commits (set "cayenne.server.external_tx" property to true. See an example in "Starting Cayenne" chapter - https://cayenne.apache.org/docs/4.0/cayenne-guide/#starting-cayenne )
So this indeed should not be an issue.
> Cayennne sends commit
> ---------------------
>
> Key: CAY-2638
> URL: https://issues.apache.org/jira/browse/CAY-2638
> Project: Cayenne
> Issue Type: Bug
> Components: Core Library
> Affects Versions: 4.1.RC2
> Reporter: Tomas Jura
> Priority: Major
> Attachments: commit_log.txt
>
>
> The cayenne sends the commits to the database ( after a lazy fetch, ... ). The transaction boundaries are defined by a superior business logic and ORM must not corrupt this logic and boundaries. Imagine for example that the Cayenne is part of an XA transaction, where the commit is controled by a transaction manager and the commit guided by two phase commit protocol. I'm afraid that any attempt to control transaction boundaries from ORM sooner or later clash with required boundaries.
> This design feature, automaticaly reject using cayenne as an ORM for any bit complex project which want to use savepoint/rollback/commit commands. As far as I remember Cayenne 3 did not touched the transaction state. Why Cayenne 4 touching the transaction?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)