[JIRA] (OSJ-342) Investigate Strategies to end of life our use of Hibernate in V5

Ian Young (Jira) jira at shibboleth.atlassian.net
Wed Dec 22 15:17:42 UTC 2021


Ian Young ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae127cb03-43ed-473d-b6ba-592949cb4be8 ) *commented* on OSJ-342 ( https://shibboleth.atlassian.net/browse/OSJ-342?atlOrigin=eyJpIjoiMDY4NTA0ZDIxMDU1NDE5MGFkNThkNzk4OGE1Mjc0ZTEiLCJwIjoiaiJ9 )

Re: Investigate Strategies to end of life our use of Hibernate in V5 ( https://shibboleth.atlassian.net/browse/OSJ-342?atlOrigin=eyJpIjoiMDY4NTA0ZDIxMDU1NDE5MGFkNThkNzk4OGE1Mjc0ZTEiLCJwIjoiaiJ9 )

As another snippet pushing for getting off Hibernate, I will note that in porting to the Jakarta EE 9 stack ( JPAR-186 ( https://shibboleth.atlassian.net/browse/JPAR-186 ) In Progress ) I came across a place in our JPAStorageService which appears to be incompatible with Hibernate 6.0.0.Beta3, which is the current iteration for that context. It may of course get fixed, but for now our tests fail because the JPAStorageServiceTest’s tearDown method calls

List<String> contexts1 = storageService.readContexts();

The code path includes this:

           // this query uses the distinct keyword, it must use optimistic locking
           return executeNamedQuery(manager, "JPAStorageRecord.findAllContexts", null, String.class,
                   LockModeType.OPTIMISTIC);

The query in question does indeed include DISTINCT:

   @NamedQuery(name = "JPAStorageRecord.findAllContexts",
           query = "SELECT distinct r.context FROM JPAStorageRecord r"),

This fails with:

java.lang.RuntimeException:
  java.io.IOException:
  java.lang.IllegalStateException:
  org.hibernate.query.IllegalQueryOperationException:
     Locking with DISTINCT is not supported!

I will catch this explicitly in the dev/JPAR-186 branch (essentially removing tearDown for now) to make progress, on the basis that if we’re removing Hibernate this won’t be an ongoing issue. We need to revisit before V5 either way.

( https://shibboleth.atlassian.net/browse/OSJ-342#add-comment?atlOrigin=eyJpIjoiMDY4NTA0ZDIxMDU1NDE5MGFkNThkNzk4OGE1Mjc0ZTEiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/OSJ-342#add-comment?atlOrigin=eyJpIjoiMDY4NTA0ZDIxMDU1NDE5MGFkNThkNzk4OGE1Mjc0ZTEiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100187- sha1:76abc0a )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20211222/a0f2552d/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-b70025f9-5824-4157-86de-bafc3b64b1c3
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20211222/a0f2552d/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-af4d7de2-ea92-4ffa-b7dd-0fe07f42338a
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20211222/a0f2552d/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-2c8123f1-4f5e-4e4e-9308-a215481d69ee
Type: image/png
Size: 468 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20211222/a0f2552d/attachment-0005.png>


More information about the commits mailing list