Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Race conditions in EclipseLink runtime?

On Wed, May 5, 2010 at 1:30 PM, Tom Ware <tom.ware@xxxxxxxxxx> wrote:
> Hi Laird,
>  EclipseLink does not spawn threads.  EclipseLink does some concurrency
> management of the objects it is managing mainly related to various levels of
> caching.  What are the syptoms of the failure?  Is there an exception?  Are
> results different?  Is SQL not as expected?

Hello, Tom; thanks for the response.

The symptoms take one of two forms, and there doesn't seem to be rhyme
or reason about which error I'm likely to see.

The first is a complaint that a particular object used as a key in a
Map is null.  I'll go into more detail in a subsequent email.  Eclipse
throws an exception here.  The next time it fails, I'll capture the

The second is that periodically EclipseLink will get confused and try
to instantiate the abstract root of an entity hierarchy directly when
a subclass is trying to be inserted.  Specifically, I have an
AtomicNameEntity class that extends NameEntity.  Both are marked as
@Entity.  NameEntity, being the root of the hierarchy, defines an
@Inheritance of type SINGLE_TABLE.  Sometimes EclipseLink, on being
told to persist an AtomicNameEntity object will throw an
InstantiationException trying, for some reason, to create a new
instance of NameEntity.  NameEntity is abstract, as permitted by the
JPA 2.0 specification; AtomicNameEntity obviously is not.

Here are the top-level mappings:

@DiscriminatorColumn(name = "kind", length = 30)
@Entity(name = "Name")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "Name")
public abstract class NameEntity implements Name {


@Entity(name = "AtomicName")
public class AtomicNameEntity extends NameEntity {

I realize this is vague.  I am just trying to poke a bit to see if
there's an obvious area to look at or isolate before going through the
multi-hour effort of putting together a test case for all this.


Back to the top