![]() Please wait while updating issue type...
Could not save your changes
This issue has been changed since you started editing it
Data that has been changed is highlighted in red below. Undo your changes to see the updated information
You have changed this issue, but haven't saved your changes yet. To save it, press the Save changes button to the right
This issue is blocking the next release
![]() There are no comments
There is nothing attached to this issue
This issue has no duplicates
There are no code checkins for this issue |
|||||||||||||||||||||||||||||||||||
Really delete this comment?
Really delete this comment?
Really delete this comment?
To conclude, what you observe is the expected behavior, unless I missed something?
Really delete this comment?
Really delete this comment?
as i added the HikariCP jar file to the drivers classpath everything is workin fine. Next step is to add Hibernate. Sadly there is no documentation about this in the offical jppf page.
So i added all the Hibernate jars to the driver, made up a new task class, entity and persistent xml. The first Client runs the code perfect. But the second time i got a similar error.
Entite ⇑ top
Task ⇑ top
persistence.xml ⇑ top
Node Output ⇑ top
Mybe Hibernate stores the entitie class and the second client reload it. But i dont want to put my entities inside another jar and deliver it by hand to the lib-ext of the driver.
Best practice meybe would be that i can say persist a datasource / entitymanagerfactory for all clients with another node mothod, so that just one classloader is involved in this special case.
lolo4j wrote:
Really delete this comment?
To try and understand how the entity class is loaded, I added this piece of code to the class Jppftest:
This provides the following output at first execution of the task:
According to this, the entity class is actually loaded when the EntityManagrFactory is created, hence the problem.
So here there isn't much that can be done. I don't think evne customizing the Hibernate bootstraping will help.
Right now, I see only 2 ways to get around this problem from the JPPF perspective:
Really delete this comment?
thank you for your fast reply. I testet option 2. But as soon i change the entity and changed the uuid of the client. The single Node is waiting for the older Task with the old classes to be finish. I react on the class cast ex. by open a new emf. But the old connectionpool is still open cause i cant close the emf cause i cant cast it.
double connection pool MBeans
Threads
Is there a way to close the emf when i make up a new one?
lolo4j wrote:
Really delete this comment?
From what I've seen in the Hibernate documentation, it supports the "hibernate.connection.datasource" configuration property, which can reference either a JNDI name or a concrete DataSource implementation. This allows providing the datasource when creating the EntityManagerFactory via Persistence.createEntityManagerFactory(String, Map). According to this, I tested the following additions/changes in HibernateTask:
This works like a charm for me.
Really delete this comment?