You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Shon Schetnan <sh...@proviseo.com> on 2003/04/15 19:46:08 UTC

Problem using ODMG API

I am having trouble getting the ODBM API to work with OJB.  I have gotten
the PB API to work fine, but when I execute the following code, I get an
exception I have not been able to find a solution to.  Any help would be
greatly appreciated.

 

 

 

                  Implementation odmg = OJB.getInstance();

                  Database db = odmg.newDatabase();

                  db.open("default", Database.OPEN_READ_WRITE);

 

            

                  Transaction tx = odmg.newTransaction();

                  tx.begin();

      

                  OQLQuery query = odmg.newOQLQuery();

                  query.create("select profile from
com.proviseo.cds.domain.UserProfile where profile.id = " + 4334947);

                        DList profiles = (DList) query.execute();

                  tx.commit();

      

                  java.util.Iterator iter = profiles.iterator();

                  UserProfile profile = (UserProfile)iter.next();

                  

                  System.out.println("OQL queried profile = " +
profile.getUserName());

 

 

[org.apache.ojb.odmg.collections.DListImpl] ERROR: Generation of new id
failed

 

Could not grab next id, failed with 

Io exception: Socket closed

Creation of new sequence failed with 

Io exception: Socket closed

: Io exception: Socket closed

java.sql.SQLException: Io exception: Socket closed

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:180)

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:222)

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:335)

      at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:496)

      at
oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.
java:619)

      at
oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:51
3)

      at
org.apache.ojb.broker.accesslayer.StatementsForClassImpl.createStatement(Unk
nown Source)

      at
org.apache.ojb.broker.accesslayer.StatementsForClassImpl.getGenericStmt(Unkn
own Source)

      at
org.apache.ojb.broker.accesslayer.StatementManager.getGenericStatement(Unkno
wn Source)

      at
org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.createSequenc
e(Unknown Source)

      at
org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUniqueLong
(Unknown Source)

      at
org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl.getUniqueId(U
nknown Source)

      at
org.apache.ojb.broker.util.sequence.AbstractSequenceManager.getUniqueValue(U
nknown Source)

      at org.apache.ojb.odmg.collections.DListImpl.generateNewId(Unknown
Source)

      at org.apache.ojb.odmg.collections.DListImpl.<init>(Unknown Source)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

      at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)

      at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.java:27)

      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)

      at java.lang.Class.newInstance0(Class.java:306)

      at java.lang.Class.newInstance(Class.java:259)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(Un
known Source)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(Un
known Source)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuery(Un
known Source)

      at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getCollectionByQu
ery(Unknown Source)

      at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(Unknown Source)

      at com.proviseo.cds.domain.OJBTest.testOQLLookup(OJBTest.java:211)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

      at java.lang.reflect.Method.invoke(Method.java:324)

      at junit.framework.TestCase.runTest(TestCase.java:154)

      at junit.framework.TestCase.runBare(TestCase.java:127)

      at junit.framework.TestResult$1.protect(TestResult.java:106)

      at junit.framework.TestResult.runProtected(TestResult.java:124)

      at junit.framework.TestResult.run(TestResult.java:109)

      at junit.framework.TestCase.run(TestCase.java:118)

      at junit.framework.TestSuite.runTest(TestSuite.java:208)

      at junit.framework.TestSuite.run(TestSuite.java:203)

      at junit.textui.TestRunner.doRun(TestRunner.java:116)

      at junit.textui.TestRunner.doRun(TestRunner.java:109)

      at junit.textui.TestRunner.run(TestRunner.java:72)

      at junit.textui.TestRunner.run(TestRunner.java:57)

      at com.proviseo.cds.domain.OJBTest.main(OJBTest.java:36)