Issue Details (XML | Word | Printable)

Key: NUCRDBMS-289
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Andy Jefferson
Reporter: Mariusz Walania
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

NullPointerException when getting null blob from OracleBlobRDBMSMapping

Created: 27/Nov/09 04:37 PM   Updated: 26/Dec/09 12:56 PM   Resolved: 27/Nov/09 09:05 PM
Component/s: None
Affects Version/s: 1.1.6
Fix Version/s: 2.0.0.m4

File Attachments: 1. Java Source File OracleBlobRDBMSMapping.java (21 kB)
2. Zip Archive test-case.zip (3 kB)

Environment:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
Driver: ojdbc14.jar (10.2.0.4.0)

Datastore: Oracle


 Description  « Hide
When getting PersistenceCapable object, containing a byte[] field mapped to BLOB, NullPointerException is thrown.

1. autoCreateSchema and autoCreateColumns is set to false.
2. table is created with the script
3. some data is populated into this table but BLOB columns are null (they are NOT populated with EMPTY_BLOB() function)
4. PC objects mapped to this table are fetched with PersistenceManager -> NPE is thrown then.

I created a test for this issue. This test
- drops table (ignores if not exists)
- creates the table
- populates some data
- then by using PersistenceManager my PC object is fetched

Stacktrace for the test below:
{code}
java.lang.NullPointerException
at org.datanucleus.store.rdbms.mapping.oracle.OracleBlobRDBMSMapping.getObject(OracleBlobRDBMSMapping.java:130)
at org.datanucleus.store.mapped.mapping.AbstractContainerMapping.getObject(AbstractContainerMapping.java:241)
at org.datanucleus.store.rdbms.fieldmanager.ResultSetGetter.fetchObjectField(ResultSetGetter.java:153)
at org.datanucleus.state.AbstractStateManager.replacingObjectField(AbstractStateManager.java:1171)
at org.datanucleus.test.MyClass1.jdoReplaceField(MyClass1.java)
at org.datanucleus.test.MyClass1.jdoReplaceFields(MyClass1.java)
at org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:2684)
at org.datanucleus.state.JDOStateManagerImpl.replaceFields(JDOStateManagerImpl.java:2703)
at org.datanucleus.store.rdbms.request.FetchRequest2.execute(FetchRequest2.java:334)
at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.fetchObject(RDBMSPersistenceHandler.java:284)
at org.datanucleus.state.JDOStateManagerImpl.loadUnloadedFieldsInFetchPlan(JDOStateManagerImpl.java:1627)
at org.datanucleus.state.JDOStateManagerImpl.loadFieldsInFetchPlan(JDOStateManagerImpl.java:1603)
at org.datanucleus.ObjectManagerImpl.performDetachAllOnCommitPreparation(ObjectManagerImpl.java:3198)
at org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:2936)
at org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:363)
at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:250)
at org.datanucleus.jdo.JDOTransaction.commit(JDOTransaction.java:83)
at org.datanucleus.test.Main.getObject(Main.java:74)
at org.datanucleus.test.Main.main(Main.java:53)
{code}

Sort Order: Ascending order - Click to sort in descending order
Mariusz Walania added a comment - 27/Nov/09 04:38 PM
Attaching test-case.zip

Mariusz Walania added a comment - 27/Nov/09 04:39 PM
Attaching fix proposal (OracleBlobRDBMSMapping.java)

Andy Jefferson added a comment - 27/Nov/09 09:05 PM
SVN trunk has this. For future reference, would be easier to determine what you've changed by attaching a patch rather than the file itself, since it would be much much smaller and applyable to different branches

Mariusz Walania added a comment - 27/Nov/09 10:09 PM
I thought this issue would be resolved in 1.1.x branch too.
Isn't it developed parallely with trunk?

Andy Jefferson added a comment - 27/Nov/09 10:28 PM
As all docs say, 1.1 is over. People wanting development on it can easily sponsor such work, and also the time taken to do subsequent releases on it