Re: M3 feature preview
Jurgen Doll <[email protected]> Sun, 12 Jul 2026 10:10:59 +0200
| Newsgroups | gmane.comp.java.cayenne.devel |
|---|---|
| Message-ID | <[email protected]> |
--6a534c13_0_92490bdb Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Andrus Wrt autoCommit I'm a bit puzzled as to why: =22Cayenne no longer wraps se= lecting queries ....=22 therefore =22.... this means that for the first t= ime Cayenne operates with Connection 'autoCommit=3Dtrue'=22 =3F Are selec= ts and autoCommit related in some way =3F I'm asking because in my understanding autoCommit is only relevant to upd= ates and inserts which will still be wrapped as transactions won't they =3F= Or are you saying that there isn't any default transaction wrapping at al= l any more in Cayenne, even for inserts and updates =3F Thanks for a great library=21 Jurgen On Jul 11 2026, at 9:21 pm, Andrus Adamchik <aadamchik=40gmail.com> wrote= : > As a Cayenne user, the majority of my apps in the last 25 years were =22= autoCommit=3Dfalse=22 just because that's how the framework worked. So th= is is also new to me and based on research, not production experience. So= I'd very much like to get community feedback on the actual behavior and = potential pitfalls. > > Andrus > > > On Jul 11, 2026, at 4:52=E2=80=AFAM, giulio.cesare=40gmail.com wrote:= > > > > Hello Andrus, > > > >> But this means that for the first time Cayenne operates with Connect= ion =22autoCommit=3Dtrue=22. > > > > =F0=9F=98=B1 > > This setting is more scary that an Halloween costume to me=21 =F0=9F=98= =85 > > I trust your understanding of the trade-offs at play, but I have > > always considered autoCommit the option used by toy projects, not > > suitable for serious tasks. > > > > But my views may well be obsolete by now. =F0=9F=98=81 > > > > Cheers, and =E2=80=93as always=E2=80=93 huge congratulations to all p= eople involved in > > moving the project forward. > > > > Giulio Cesare > > > > On Tue, Jul 7, 2026 at 3:17=E2=80=AFPM Andrus Adamchik <aadamchik=40g= mail.com> wrote: > >> > >> I am glad the new change didn't break much stuff :) Always a concern= with all the new ideas. > >> > >> BTW, as you probably noticed, we are now exposing translated queries= with parameters as standalone record objects instead of going straight f= rom translator to PreparedStatement, so they can be captured, inspected, = logged, etc (e.g., what the SQLLogger does). > >> > >> And on the broader topic of observability, we started an effort to i= ntegrate OpenTelemetry into Bootique, and I hope this will come back to C= ayenne as well. Would be nice to have otel spans for queries. But as your= video demonstrates, explicit instrumentation is almost irrelevant these = days. The tools are so good... they can grab the logs, or do automated ru= ntime instrumentation and show you transaction traces with next to zero e= ffort. > >> > >> Andrus > >> > >> > >> > >>> On Jul 6, 2026, at 7:15=E2=80=AFPM, Hugi Thordarson <hugi=40karlmen= n.is> wrote: > >>> > >>> Hi Andrus, > >>> > >>> first =E2=80=94 that logging is a vast, vast improvement, I'm lovin= g it=21 > >>> > >>> So happens I've been playing a lot with Cayenne's logging lately. V= ery happy about how easy it was/is to hook into query logging and I've us= ed it to profile SQL-queries in my web application templates for years no= w =E2=80=94 keeping track of the time methods spend querying to find perf= ormance problems (profiling/aggregating by bindings rather than methods r= eally, in WO terms) and watching the SQL they executed. > >>> > >>> Helpful, but has always been private utility logic for myself since= it just prints ugly text reports and I never took the time to make it pr= etty and usable for others. > >>> > >>> But that was before Claude :). So now there's this: Inline SQL logg= ing. Probably easiest described through video =E2=80=94 https://www.youtu= be.com/watch=3Fv=3DhoW1WusKSRo . > >>> > >>> =E2=80=A6works great with the new SQLLogger interface. Already port= ed, since I'll be switching to -SNAPSHOT (in dev only for a while, to tes= t the behaviour of the new transaction setup, really looking forward to p= utting it through it's paces). > >>> Been using M2 in production since release and it works great, congr= ats on another awesome release :). > >>> > >>> Cheers, > >>> - hugi > >>> > >>> > >>> > >>>> On 6 Jul 2026, at 13:37, Andrus Adamchik <aadamchik=40gmail.com> w= rote: > >>>> > >>>> Hi, > >>>> > >>>> I wanted to highlight a few things in the upcoming M3. They are al= ready on master, so maybe some brave souls can take it for a spin and giv= e us feedback :) > >>>> > >>>> 1. Cayenne no longer wraps selecting queries (or at least those it= can reliably identify as selecting) into transactions. > >>>> > >>>> I had a suspicion for years that we shouldn't be doing that. Now I= was able to vibecode real benchmarks on multiple databases, and time sav= ings in the JDBC layer with faster queries are about 2x=21 (as each usele= ss =22commit=22 is a separate command sent to DB that needs to be process= ed). But this means that for the first time Cayenne operates with Connect= ion =22autoCommit=3Dtrue=22. So I'd appreciate feedback if this causes an= y weirdness with your DataSources. > >>>> > >>>> > >>>> 2. SQL logging changes. There are multiple changes. Some address o= perational concerns (saving hundreds of GB of storage space; single-line = logs are easier to parse), others are =22quality of life=22: > >>>> > >>>> * No tx for selects (mentioned above) by itself cuts down on 2 log= lines per query > >>>> * The new logger name is short and descriptive =22cayenne-sql=22 > >>>> * ERROR log level for queries that result in exceptions > >>>> * SQL query logs are single-line. Parameters, timers, result count= ers, generated keys are placed on one line and rendered in a compact form= at. Tx wrapping is still done on separate lines (as a tx can include more= than one SQL statement) > >>>> > >>>> IN=46O cayenne-sql tx started > >>>> IN=46O cayenne-sql INSERT INTO BINARY=5FPK=5FTEST1(BIN=5FID, NAME)= VALUES(=3F, =3F) =7C bind:=5BBIN=5FID:=46BBC4034ED8=460214B2C559C=461029= C1868A66=460D59208A36C9365126C248C...,NAME:'master1'=5D updated:1 time=5F= ms:0 > >>>> IN=46O cayenne-sql tx committed > >>>> > >>>> * Mnemonic table aliases. No more meaningless t0, t1, t2: > >>>> > >>>> IN=46O cayenne-sql SELECT p.ESTIMATED=5FPRICE, p.PAINTING=5FDESCRI= PTION, p.PAINTING=5FTITLE, p.ARTIST=5FID, p.GALLERY=5FID, p.PAINTING=5FID= , g.GALLERY=5FID, g.GALLERY=5FNAME =46ROM PAINTING p LE=46T JOIN GALLERY = g ON p.GALLERY=5FID =3D g.GALLERY=5FID =7C selected:1 time=5Fms:0 > >>>> > >>>> * No alias for single-table queries > >>>> > >>>> IN=46O cayenne-sql - SELECT ESTIMATED=5FPRICE, PAINTING=5FDESCRIPT= ION, PAINTING=5FTITLE, ARTIST=5FID, GALLERY=5FID, PAINTING=5FID =46ROM PA= INTING =7C selected:2 time=5Fms:0 > >>>> > >>>> > >>>> (I am also thinking of lowercasing the SQL so that logs don't look= like they are screaming at you :)) > >>>> > >>>> Andrus > >>>> > >>>> > >>>> > >>>> > >>> > >> > --6a534c13_0_92490bdb--