You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (Jira)" <ji...@apache.org> on 2020/11/18 13:43:00 UTC

[jira] [Updated] (CAY-2637) Allow forcing a custom Connection for a transaction

     [ https://issues.apache.org/jira/browse/CAY-2637?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nikita Timofeev updated CAY-2637:
---------------------------------
    Fix Version/s: 4.2.M3

> Allow forcing a custom Connection for a transaction
> ---------------------------------------------------
>
>                 Key: CAY-2637
>                 URL: https://issues.apache.org/jira/browse/CAY-2637
>             Project: Cayenne
>          Issue Type: Task
>            Reporter: Andrus Adamchik
>            Priority: Major
>             Fix For: 4.2.M3
>
>
> Just identified a use case where Cayenne transaction management API falls short. 
> [DFLib|https://github.com/nhl/dflib] JDBCConnector allows manual transaction management. I am using Cayenne with DFLib for a multi-step data transformation process, with multiple commits within a transaction. Cayenne queries should be able to include intermediate results flushed to DB (but still not committed), so they need to run over the same Connection. 
> I was able to implement a custom solution that required wrapping both DataSource and Transaction in custom classes. I think we can simplify this for the end users. Some ideas:
> * add the ability to pass an explicit DataSource (and/or Connection) to TransactionDescriptor. Expand ServerRuntime.performInTransaction(..) to take TransactionDescriptor (just like TransactionManager does).
> * allow TransactionListener to provide its own connection, both in "willAddConnection" (so it can wrap passed connection), or in a separate new method that would allow to provide own Connection before Cayenne checks out one from its own DataSource.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)