openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kazuaki SUZUKI <campanalb...@gmail.com>
Subject Re: TestEmbeddableSuperclass get Optimistic locking error on Oracle
Date Mon, 30 May 2011 08:37:15 GMT
Hi

The error occur in OpenJPA 2.0.2 but don't occur in OpenJPA 2.1.0 and 2.2.0.

I made the minimum test classes to be errored for OpenJPA2.0.2 and Oracle
10g.

-----

package
org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype;

import javax.persistence.*;

@Entity
public class MinEmbeddableSuperSub extends MinEmbeddableSuper {
    @ManyToOne
    private MinEmbeddableSuper sup;
}

-----

package
org.apache.openjpa.persistence.annotations.common.apps.annotApp.annotype;

import javax.persistence.*;

@MappedSuperclass
public class MinEmbeddableSuper {

    @Version
    private int version;
}

-----

If you persist the entity class in Oracle, you get following error.

Attempt to set column "MinEmbeddableSuperSub.version" to two different
values: (class java.lang.Integer)"0", (class java.lang.Integer)"1" This can
occur when you fail to set both sides of a two-sided relation between
objects, or when you map different fields to the same column, but you do not
keep the values of these fields in synch.



thank you

Kazuaki SUZUKI


--
View this message in context: http://openjpa.208410.n2.nabble.com/TestEmbeddableSuperclass-get-Optimistic-locking-error-on-Oracle-tp6394236p6418273.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Mime
View raw message