Sorry for the confusion. No I'm not using those callbacks on an Embeddable but 
when I switched to OpenJPA, I remember that I had to add the classes with 
@Embeddable into persistence.xml whereas it wasn't necessary with Hibernate.

The class that uses those callbacks uses the annotation @Singleton, removing it 
doesn't solve my problem.

Please find enclosed the file.


> Message du 14/10/14 17:31
> De : "Rick Curtis" 
> A : "users" , goues...@orange.fr
> Copie à : 
> Objet : Re: javax.persistence.EntityListeners is never called
> 
>
2.4.x is the latest.

>
If I understand your previous posts, are you using callbacks(@Preload, 
@Postload, etc, etc) on an Embeddable? If that is the case, I'm not sure if it 
is suppose to work? Can I have you post some Entity/embeddable snippets so we 
can better understand what you want to do?

>
Thanks,
Rick
>

>

>



>
On Tue, Oct 14, 2014 at 8:20 AM,  wrote:
>
I use OpenJPA 2.4.0. I'm going to try with a more recent version if any.
> 
> 
> 
> 
> 
> 
> > Message du 14/10/14 00:14
> > De : "Kevin Sutter"
> > A : users@openjpa.apache.org, goues...@orange.fr
> > Copie à :
> > Objet : Re: javax.persistence.EntityListeners is never called
> >
> > Hi,
> > The complete trace can be turned on via this property in your p.xml:
> >
> >
> >
> > Good luck,
> > Kevin
>

>
> > On Mon, Oct 13, 2014 at 1:01 PM,  wrote:
> >
> > > Hi
> > >
> > > I use Apache OpenEJB 4.7.1 (probably OpenJPA 2.2 or 2.3). I have looked at
> > > the logs and I have already done my best to force the persistence of all
> > > entity classes including those Hibernate was able to discover alone, for
> > > example the class using @Embeddable. As I'm currently not at work, I can't
> > > post the persistence.xml but I'll do it tomorrow. What should I turn on to
> > > get some more trace? Thank you for your help.
> > >
> > >
> > >
> > >
> > > > Message du 13/10/14 19:07
> > > > De : "Kevin Sutter"
> > > > A : users@openjpa.apache.org, goues...@orange.fr
> > > > Copie à :
> > > > Objet : Re: javax.persistence.EntityListeners is never called
> > > >
> > > > Hi,
> > > > EntityListeners should work just fine with OpenJPA. What version of
> > > > OpenJPA are you using? The basic support is documented here:
> > > >
> > > http://ci.apache.org/projects/openjpa/trunk/docbook/manual.html#jpa_overview_pc_callbacks
> > > >
> > > > Are there any other messages in the logs that indicate an issue? Have 
> > > > you
> > > > tried turning on Trace to ensure that normal persistence processing is
> > > > happening? Can you post your p.xml? Like I mentioned, this should all
> > > > just work. We'll need a bit more context to help figure out the problem.
> > > >
> > > > Kevin
> > > >
> > > > On Mon, Oct 13, 2014 at 10:56 AM, wrote:
> > > >
> > > > > Hello
> > > > >
> > > > > I use javax.persistence.EntityListeners. The persistent classes of the
> > > > > entities are correctly added into persistence.xml. My test case works
> > > > > correctly with Hibernate and OpenJPA except that the annotated methods
> > > > > (with @PostLoad, @PreUpdate, @PrePersist and @PostRemove) are never
> > > called
> > > > > by OpenJPA whereas they are called by Hibernate. Am I missing anything
> > > > > obvious? Best regards.
> > > > >
> > > >
> > >
> >
>




> 

>
-- 
> Rick Curtis
>
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";>
  <persistence-unit name="*****WebServicesPU" transaction-type="JTA">
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <jta-data-source>java:/*****WebServicesDS</jta-data-source>
    <class>com.******.*****.ejbs.utils.MultiLangString</class>
    <shared-cache-mode>NONE</shared-cache-mode>
    <properties>
      <property name="hibernate.show_sql" value="false"/>
      <property name="hibernate.format_sql" value="false"/>
      <property name="use_sql_comments" value="false"/>
      <property name="javax.persistence.jdbc.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
      <property name="hibernate.id.new_generator_mappings" value="true"/>
      <property name="openjpa.Multithreaded" value="true"/>
      <property name="openjpa.Log" value="DefaultLevel=TRACE"/>
    </properties>
  </persistence-unit>
</persistence>

Reply via email to