Re: Transactions

Andrus Adamchik <[email protected]> Sat, 4 Oct 2025 18:19:47 -0400
Newsgroups gmane.comp.java.cayenne.user
Message-ID <[email protected]>
Hi Ricardo,

Yes, Cayenne provides transaction API with access to JDBC connections:

=
https://cayenne.apache.org/docs/5.0/cayenne-guide/persistent-objects-objec=
tcontext/#transactions

You can use one of CayenneRuntime "performInTransaction(..)" flavors to =
wrap both Cayenne and direct JDBC operations and access Transaction =
object and its connections via "BaseTransaction.getThreadTransaction()" =
while inside the tx.

Thanks,
Andrus



> On Oct 4, 2025, at 5:51=E2=80=AFPM, Ricardo Parada =
<[email protected]> wrote:
>=20
> Hello everyone,
>=20
> Let=E2=80=99s say I want to get a JDBC Connection to do something =
special and then update some Cayenne objects (Artist, Painting) and then =
have commitChanges() update the objects in the database but also commit =
whatever work was done on the JDBC Connection.
>=20
> Is it possible to enlist the JDBC connection to participate in a =
transaction with Cayenne?
>=20
> Thank you in advance for any information.=20
>=20
> Ricardo Parada
>=20