DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCRDBMS-186
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Yang ZHONG
Votes: 0
Watchers: 0
Operations

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

DB2 : To support default JDO boolean mapping on DB2

Created: 21/May/09 10:11 PM   Updated: 20/Oct/10 09:30 AM   Resolved: 13/Oct/10 11:16 AM
Component/s: Types
Affects Version/s: 1.1.3
Fix Version/s: 2.2.0.m2

File Attachments: 1. Zip Archive 186.zip (3 kB)

Environment: Linux, Java 5, DB2 9.1

Forum Thread URL: http://www.jpox.org/servlet/forum/viewthread_thread,5222
Datastore: IBM DB2
Severity: Production


 Description  « Hide
The JDO specification (2.1 page 218 "Table 8: Default jdbc-type") specifies the default Java boolean mapping is JDBC BIT. However, DataNucleus 1.1.3 complains not supported on DB2. Maybe DataNucleus can be improved to simulate BIT Number type w/ SmallInt which is the closest Number type on DB2.

NFO: >> Exception thrown persisting objects
Throwable occurred: javax.jdo.JDOFatalInternalException: JDBC type BIT declared for field "org.datanucleus.test.Bool.bool" of java type java.lang.Boolean cant be mapped for this datastore.
  at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:399)
  at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:674)
  at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:694)
  at org.datanucleus.test.Main.main(Main.java:52)
NestedThrowablesStackTrace:
JDBC type BIT declared for field "org.datanucleus.test.Bool.bool" of java type java.lang.Boolean cant be mapped for this datastore.
org.datanucleus.exceptions.NucleusException: JDBC type BIT declared for field "org.datanucleus.test.Bool.bool" of java type java.lang.Boolean cant be mapped for this datastore.
  at org.datanucleus.store.rdbms.mapping.RDBMSMappingManager.getDatastoreMappingClass(RDBMSMappingManager.java:325)
  at org.datanucleus.store.rdbms.mapping.RDBMSMappingManager.createDatastoreMapping(RDBMSMappingManager.java:530)
  at org.datanucleus.store.mapped.mapping.SingleFieldMapping.prepareDatastoreMapping(SingleFieldMapping.java:57)
  at org.datanucleus.store.mapped.mapping.SingleFieldMapping.initialize(SingleFieldMapping.java:46)
  at org.datanucleus.store.mapped.mapping.MappingFactory.createMapping(MappingFactory.java:97)
  at org.datanucleus.store.mapped.mapping.AbstractMappingManager.getMapping(AbstractMappingManager.java:248)
  at org.datanucleus.store.rdbms.table.ClassTable.manageMembers(ClassTable.java:567)
  at org.datanucleus.store.rdbms.table.ClassTable.manageClass(ClassTable.java:447)
  at org.datanucleus.store.rdbms.table.ClassTable.initializeForClass(ClassTable.java:1086)
  at org.datanucleus.store.rdbms.table.ClassTable.initialize(ClassTable.java:264)
  at org.datanucleus.store.rdbms.RDBMSManager$ClassAdder.initializeClassTables(RDBMSManager.java:2642)
  at org.datanucleus.store.rdbms.RDBMSManager$ClassAdder.addClassTablesAndValidate(RDBMSManager.java:2549)
  at org.datanucleus.store.rdbms.RDBMSManager$ClassAdder.run(RDBMSManager.java:2200)
  at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:113)
  at org.datanucleus.store.rdbms.RDBMSManager.addClasses(RDBMSManager.java:992)
  at org.datanucleus.store.rdbms.RDBMSManager.addClasses(RDBMSManager.java:958)
  at org.datanucleus.store.AbstractStoreManager.addClass(AbstractStoreManager.java:725)
  at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass(MappedStoreManager.java:358)
  at org.datanucleus.store.rdbms.RDBMSManager.getPropertiesForGenerator(RDBMSManager.java:1510)
  at org.datanucleus.store.AbstractStoreManager.getStrategyValue(AbstractStoreManager.java:1078)
  at org.datanucleus.ObjectManagerImpl.newObjectId(ObjectManagerImpl.java:2599)
  at org.datanucleus.state.JDOStateManagerImpl.setIdentity(JDOStateManagerImpl.java:873)
  at org.datanucleus.state.JDOStateManagerImpl.initialiseForPersistentNew(JDOStateManagerImpl.java:458)
  at org.datanucleus.state.StateManagerFactory.newStateManagerForPersistentNew(StateManagerFactory.java:151)
  at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1300)
  at org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1178)
  at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:669)
  at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:694)
  at org.datanucleus.test.Main.main(Main.java:52)

Yang ZHONG added a comment - 21/May/09 10:12 PM
Thanks.

Yang ZHONG made changes - 21/May/09 10:12 PM
Field Original Value New Value
Attachment 186.zip [ 10942 ]
Andy Jefferson made changes - 10/Dec/09 11:15 AM
Summary To support default JDO boolean mapping on DB2 DB2 : To support default JDO boolean mapping on DB2
Andy Jefferson added a comment - 13/Oct/10 11:16 AM
SVN trunk works for me. Not tried against any other versions

Andy Jefferson made changes - 13/Oct/10 11:16 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.2.0.m2 [ 11023 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 20/Oct/10 09:30 AM
Status Resolved [ 5 ] Closed [ 6 ]