hibernate-orm icon indicating copy to clipboard operation
hibernate-orm copied to clipboard

HHH-18319 fix wrong statement in user guide regarding auto-flush in event of native Session and query

Open NathanQingyangXu opened this issue 1 year ago • 6 comments

https://hibernate.atlassian.net/browse/HHH-18319

It seems a mis-statement about auto-flush in event of native Session and native SQL. I might be wrong but it is so confusing.

NathanQingyangXu avatar Jun 29 '24 14:06 NathanQingyangXu

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

I don't understand this statement at all. AFAIK JPA vs native bootstrap doesn't affect auto flush at all ... at least it shouldnt.

gavinking avatar Jun 29 '24 17:06 gavinking

There is similar doubt on stackoverflow: https://stackoverflow.com/questions/55704433/hibernate-session-not-getting-flushed-before-native-sql-query

However, somebody responded the doc is correct, which confused me even more.

Obviously the doc is incorrect, imho.

On Sat, Jun 29, 2024, 1:28 p.m. Gavin King @.***> wrote:

I don't understand this statement at all. AFAIK JPA vs native bootstrap doesn't affect auto flush at all ... at least it shouldnt.

— Reply to this email directly, view it on GitHub https://github.com/hibernate/hibernate-orm/pull/8615#issuecomment-2198269582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6UYAUZHS3ZM5R4YZLOHK3ZJ3VERAVCNFSM6AAAAABKDILUBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGI3DSNJYGI . You are receiving this because you authored the thread.Message ID: @.***>

NathanQingyangXu avatar Jun 29 '24 18:06 NathanQingyangXu

Obviously the doc is incorrect, imho.

Yes, that whole section titled "AUTO flush on native SQL query" is wildly misleading.

The new documentation has it right: https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#native-queries

gavinking avatar Jun 29 '24 19:06 gavinking

Thanks. Didn't know of the existence of this doc. Been quite a while since I contributed last time.

On Sat, Jun 29, 2024, 3:38 p.m. Gavin King @.***> wrote:

Obviously the doc is incorrect, imho.

Yes, that whole section titled "AUTO flush on native SQL query" is wildly misleading.

The new documentation has it right: https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#native-queries

— Reply to this email directly, view it on GitHub https://github.com/hibernate/hibernate-orm/pull/8615#issuecomment-2198318554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6UYAX7O7QOULURYSN3QQTZJ4EMHAVCNFSM6AAAAABKDILUBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGMYTQNJVGQ . You are receiving this because you authored the thread.Message ID: @.***>

NathanQingyangXu avatar Jun 29 '24 22:06 NathanQingyangXu

Reading the brilliant Hibernate v6 introduction doc you mentioned now. Woa, so interesting!.

On Sat, Jun 29, 2024, 3:38 p.m. Gavin King @.***> wrote:

Obviously the doc is incorrect, imho.

Yes, that whole section titled "AUTO flush on native SQL query" is wildly misleading.

The new documentation has it right: https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#native-queries

— Reply to this email directly, view it on GitHub https://github.com/hibernate/hibernate-orm/pull/8615#issuecomment-2198318554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6UYAX7O7QOULURYSN3QQTZJ4EMHAVCNFSM6AAAAABKDILUBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJYGMYTQNJVGQ . You are receiving this because you authored the thread.Message ID: @.***>

NathanQingyangXu avatar Jun 29 '24 23:06 NathanQingyangXu

We decided we would prefer a wholesale change to this section rather than piecemeal changes.

sebersole avatar Jul 23 '24 13:07 sebersole

We decided we would prefer a wholesale change to this section rather than piecemeal changes.

Makes sense. Glad I raised the concern anyway.

NathanQingyangXu avatar Jul 23 '24 14:07 NathanQingyangXu