Re: Problems with DataNucleus JDO and MS Sql Server 2012


Max Treptow
 

This is the logfile after the enhancing of o/r class Mse.java:

 

The class to get MSE data from the database:

public class MseData {

 

private PersistenceManagerFactory pmf;

private PersistenceManager pm;

 

public static void main( String[] args )

{

MseData mseData = new MseData();

mseData.listMseData2();

}

private void listMseData2() {

 

pmf = JDOHelper.getPersistenceManagerFactory("RdstTest");

pm = pmf.getPersistenceManager();

 

Extent<Mse> tExtent = pm.getExtent(Mse.class, false);

 

Iterator<Mse> mseData = tExtent.iterator();

 

while(mseData.hasNext()) {

 

Mse mse = (Mse) mseData.next();

System.out.println(mse.getTitle());

}

pm.close();

pmf.close();

}

}

The command Extent<Mse> tExtent = pm.getExtent(Mse.class, false);
throws the following exception:

Exception in thread "main" javax.jdo.JDODataStoreException: Required table missing : "DBO.MSE" in Catalog "" Schema "DBO". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.schema.autoCreateTables"


at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:553)


at org.datanucleus.api.jdo.JDOPersistenceManager.getExtent(JDOPersistenceManager.java:1550)


at eu.jcz.dnt1.app.MseData.listMseData2(MseData.java:30)


at eu.jcz.dnt1.app.MseData.main(MseData.java:22)

 

 

 

NestedThrowablesStackTrace:

 

Required table missing : "DBO.MSE" in Catalog "" Schema "DBO". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.schema.autoCreateTables"

 

 

org.datanucleus.store.rdbms.exceptions.MissingTableException: Required table missing : "DBO.MSE" in Catalog "" Schema "DBO". DataNucleus requires this table to perform its persistence operations. Either your MetaData is incorrect, or you need to enable "datanucleus.schema.autoCreateTables"


at org.datanucleus.store.rdbms.table.AbstractTable.exists(AbstractTable.java:607)


at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.performTablesValidation(RDBMSStoreManager.java:3400)


at org.datanucleus.store.rdbms.RDBMSStoreManager$ClassAdder.run(RDBMSStoreManager.java:2911)


at org.datanucleus.store.rdbms.AbstractSchemaTransaction.execute(AbstractSchemaTransaction.java:118)


at org.datanucleus.store.rdbms.RDBMSStoreManager.manageClasses(RDBMSStoreManager.java:1643)


at org.datanucleus.store.AbstractStoreManager.getExtent(AbstractStoreManager.java:987)


at org.datanucleus.ExecutionContextImpl.getExtent(ExecutionContextImpl.java:5209)


at org.datanucleus.api.jdo.JDOPersistenceManager.getExtent(JDOPersistenceManager.java:1546)


at eu.jcz.dnt1.app.MseData.listMseData2(MseData.java:30)


at eu.jcz.dnt1.app.MseData.main(MseData.java:22)

 

The whole logfile datanucleus.log is attached.

Join main@datanucleus.groups.io to automatically receive all group messages.