We're updating the issue view to help you get more done. 

Hibernate @Synchronize annotation values should be processed by NamingStrategy

Description

I had 2 Entities (one was a mapped view)

1 2 3 @Table(name = "BOOKING_INFO", schema = "BOOKING") @Entity public class BookingInfo extends AbstractBooking {
1 2 3 4 5 @Table(name = "BOOKING_VIEW", schema = "BOOKING") @Entity @Immutable @Synchronize("BOOKING.BOOKING_INFO") public class BookingView extends AbstractBooking {

However, a read-operation on BookingView after a write-operation on BookingInfo, did not trigger a flush, so stale data was read.

When debugging we found that our namingStrategy (SpringNamingStrategy, which extends ImprovedNamingStrategy) lowercases the table name, so we had to put this in the annotatoin:

1 @Synchronize("BOOKING.booking_view")

Hibernate should either apply the naming-strategies also to the values from @Synchronize or compare these case-insensitive (which could theoretically lead to too many flushes if you have a crazy database which uses tables with the same name only differentiated by casing).

Environment

Windows, Java8, Spring Boot

Status

Assignee

Steve Ebersole

Reporter

Paul Klingelhuber

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.0.Final

Priority

Major