Unable to serialize ScanResult because does not implement Serializable

Hi,

In the context of improving the creation time of the entityManagerFactory, if you want to serialize the ScanResult but it does not implement Serializable, is this intentional?

If the ScanResult references system files but they could be marked as transient since they are not crucial information once serialized.

What is your opinion?

Best regards

Because I could extract its content and reconstruct the ScanResult during deserialization.

image

and

image

I guess we are fine with such a change as long as you provide an implementation and tests for that. Create a JIRA issue and a PR for it and we’ll look into it.

it suits me perfectly, thank you.
I do this as soon as possible

Upon closer inspection, it would be more appropriate to serialize ManagedResourcesImpl because it contains the compilation of ScanResult and does not contain any links to system files.

The only problem is that I haven’t found a suitable place to override the behavior at this point in order to check for the existence of a serialized object.

Can I add an entry to number 1?
Or can I integrate the serialization mechanism I want to develop?

If so, the idea would be to condition the mechanism with a technical parameter (AvailableSetting) and manage the persistence time of the serialized file. I’m not sure yet, but I was thinking maybe using a hash code of the classpath…

Try creating a prototype and then discuss the design of it with us. We’ll see where we get from there.

1 Like

The JIRA : [HHH-16840] Allow serialization of ScanResultImpl to speed up the creation of the entityManagerFactory - Hibernate JIRA (atlassian.net)

The PR : HHH-16840 Allow serialization of ScanResultImpl by boutss · Pull Request #6863 · hibernate/hibernate-orm (github.com)

Thank you