cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] Closed: (CAY-859) Cayenne agent misses JPA entity classes that were loaded before their PersistenceUnits
Date Tue, 18 Nov 2008 13:55:11 GMT

     [ https://issues.apache.org/cayenne/browse/CAY-859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik closed CAY-859.
-------------------------------

    Resolution: Fixed

this should be closed.

> Cayenne agent misses JPA entity classes that were loaded before their PersistenceUnits
> --------------------------------------------------------------------------------------
>
>                 Key: CAY-859
>                 URL: https://issues.apache.org/cayenne/browse/CAY-859
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Cayenne JPA
>    Affects Versions: 3.0
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.0M2
>
>
> In a command line application running with Cayenne agent , the following code would result
in exceptions about Artist not being persistent:
> Class.forName("test.Artist");
> EntityManagerFactory emf = Persistence
> 				.createEntityManagerFactory("cayenne-tutorial");
> EntityManager em = emf.createEntityManager();
> tx = em.getTransaction();
> tx.begin();
> em.createQuery("delete from Artist").executeUpdate();
> Since redefining already loaded classes is not possible (instrumentation spec prohibits
adding fields to such classes for instance), the only solution I see is to trigger PersistentUnit
loading from within the agent. I am going to make it optional as it slows down app startup.
This will be an agent parameter "jpa-eager-load"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message