Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] @OptimisticLocking => NullPointerException

Hi Tom,

What version of EclipseLink?

2.4.2.v20130315-93567e3

Please provide the full stack trace.

java.lang.NullPointerException
at org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy.initUnmappedFieldsQuery(CascadeLockingPolicy.java:241) at org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy.initUnmappedFields(CascadeLockingPolicy.java:216) at org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy.lockNotifyParent(CascadeLockingPolicy.java:272) at org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy.lockNotifyParent(CascadeLockingPolicy.java:324) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges(UnitOfWorkImpl.java:655) at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:431) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:798) at com.sun.enterprise.container.common.impl.EntityManagerWrapper.flush(EntityManagerWrapper.java:418)

What object is involved, how is it mapped?

The main entity class has these annotations:

@Entity
@Table(name = "CUSTOMER_AGREEMENT", uniqueConstraints = @UniqueConstraint(columnNames = "AGREEMENT_NO"))
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "CONTRACT_TYPE", discriminatorType = DiscriminatorType.STRING, length = 1)
@OptimisticLocking(cascade = true)
public abstract class AgreementEntity ...

But the whole entity structure is pretty complex. I would need some hint on which parts to concentrte to extract it to reproduce the problem with a more simple structure.

Best regards
... Michael



On 01/07/2013 12:22 PM, Michael Hönnig wrote:
Dear EclipseLink community,

We are getting a NullPointerExcption when using @OptimisticLocking.

org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy
is the class where it happens:

CascadeLockingPolicy.initUnmappedFieldsQuery(...) {
...
SQLSelectStatement statement = new SQLSelectStatement();
Iterator<DatabaseField> itUnmappedFields =
m_unmappedQueryKeyFields.values().iterator();
...
}

called by

CascadeLockingPolicy.initUnmappedFields(...) {
...
  if(m_unmappedQueryKeyFields.isEmpty()) {
                  m_unmappedQueryKeyFields = null;
                  m_mappedQueryKeyFields = m_queryKeyFields;
              }
   initUnmappedFieldsQuery(uow);
...
}

Just 2 statements before initUnmappedFieldsQuery() is using
m_unmappedQueryKeyFields, it is set to null.

Is ths a bug or does anybody know which circumstances, e.g. annotations in our
entities, could lead to this problem?`

Best regards
... Michael

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

--
http://michael.hoennig.de


Back to the top