Bug 270801 - NullPointerException from AbstractSession.basicBeginTransaction
Summary: NullPointerException from AbstractSession.basicBeginTransaction
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-01 10:50 EDT by Sei Syvalta CLA
Modified: 2022-06-09 10:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sei Syvalta CLA 2009-04-01 10:50:44 EDT
Build ID: 1.0.2

Steps To Reproduce:
1. May be difficult, because requires DB connection to be dropped at specific time

More information:
java.lang.NullPointerException
        at org.eclipse.persistence.internal.sessions.AbstractSession.basicBeginTransaction(AbstractSession.java:394) [eclipselink-1.0.2.jar:1.0.2.20081024]
        at org.eclipse.persistence.internal.sessions.AbstractSession.basicBeginTransaction(AbstractSession.java:370) [eclipselink-1.0.2.jar:1.0.2.20081024]
        at org.eclipse.persistence.sessions.server.ClientSession.basicBeginTransaction(ClientSession.java:123) [eclipselink-1.0.2.jar:1.0.2.20081024]
        at org.eclipse.persistence.internal.sessions.AbstractSession.beginTransaction(AbstractSession.java:535) [eclipselink-1.0.2.jar:1.0.2.20081024]
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.beginTransaction(UnitOfWorkImpl.java:489) [eclipselink-1.0.2.jar:1.0.2.20081024]
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1205) [eclipselink-1.0.2.jar:1.0.2.20081024]
        at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:478) [eclipselink-1.0.2.jar:1.0.2
.20081024]
        at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithPreBuiltChangeSet(UnitOfWorkImpl.java:1370) [eclipselink-1.0.2.jar:1.0.2
.20081024]
        at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:300) [eclipselink-1.0.2.jar:1.0.2.200
81024]
        at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:384) [eclipselink-1.0.2.jar:1.0.2.20081024]


I suspect that the accessor returned by the exception is not set, which causes the NPE (stack trace of some other error):
    at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:298) [eclipselink-1.0.2.jar:1.0.2.2008102
    at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:138) [eclipselink-1.0.2.jar:1.0.2.20081024]


This is from 1.0.2, but I quickly checked code for trunk and it doesn't seem to have changes for this.
Comment 1 Tom Ware CLA 2009-04-08 11:12:32 EDT
This will be very difficult to address without more information about exactly what you are doing and how/when the DB connection gets dropped.
Comment 2 Tom Ware CLA 2009-04-08 13:32:20 EDT
Initially Targetting for 1.1.x - makes it a candiate for future 1.1 patch releases

When this bug is investgated, it should be triaged to determine if there is enough information to track down the issue and if not, it should be closed as WORKSFORME
Comment 3 Sei Syvalta CLA 2009-04-22 08:43:27 EDT
This is what I'm doing:

- start transaction
- load entity
- change some fields in the entity
- flush
--> NPE

Unfortunately I'm not sure what is exactly happening, because this is occurring  randomly in automated tests.

Before the error there are some warnings like this in the log:
[EL Info]: 2009.04.22 15:03:05.749--ClientSession(25455877)--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query.

Comment 4 Peter Krogh CLA 2009-11-27 13:54:51 EST
 This bug is being moved to Future where we can properly sort them all together based on community votes and severity. We will then assign them accordingly to future patch sets and releases.
Comment 5 Peter Krogh CLA 2009-11-30 11:38:32 EST
Changing the priority of the bugs that have been recently triaged to future.  Targetting them to P2 will differentiate them from the P3s that have been triaged into future earlier.
Comment 6 Ravi kiran N CLA 2010-07-08 09:45:22 EDT
Any updates reagrding this issue, we have been facing the same exception on high loads.
Comment 7 Tom Ware CLA 2010-08-04 11:41:06 EDT
I'd like to encourage anyone with an interest in this issue to vote for it.  We are using votes as one criteria for determining which issues to fix next.
Comment 8 Eclipse Webmaster CLA 2022-06-09 10:15:01 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:26:25 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink