Hello evrybody, I have a problem with my OJB implementation. I have the following metadata mapping with the corresponding classmodel.
class="basis.Model" table="models" identity-type="datastore">
name="id" column="id" jdbc-type="BIGINT" primarykey="true" autoincrement="true" />
name="modelItem" class-ref="basis.ModelItem" auto-retrieve="true" auto-update="true" auto-delete="true" >
class="basis.ModelI18N" table="models_i18n" identity-type="datastore">
name="id" column="id" jdbc-type="BIGINT" primarykey="true" autoincrement="true" />
name="ownerId" column="model_id" jdbc-type="BIGINT" />
name="nationId" primarykey="true" column="nation_id" jdbc-type="BIGINT" />
name="owner" class-ref="basis.Model" auto-retrieve="true" auto-update="true" >
name="nationality" class-ref="basis.Nationality" auto-retrieve="true" >
class="basis.ModelItem" proxy="dynamic" table="modelitems" identity-type="datastore">
name="id" column="id" jdbc-type="BIGINT" primarykey="true" autoincrement="true" />
name="modelId" column="model_id" jdbc-type="BIGINT" />
name="itemHierarchy" column="item_hierarchy" jdbc-type="BIGINT" />
name="modelItemsI18N" element-class-ref="basis.ModelItemI18N" orderby="id" sort="asc" auto-retrieve="true" auto-update="true" auto-delete="true" >
name="parent" class-ref="basis.ModelItem" auto-retrieve="true" auto-update="true" >
name="model" class-ref="basis.Model" auto-retrieve="true" auto-update="true" >
name="children" element-class-ref="basis.ModelItem" orderby="id" sort="asc" auto-retrieve="true" auto-update="true" auto-delete="true" >
class="basis.ModelItemI18N" proxy="dynamic" table="modelitems_i18n" identity-type="datastore">
name="id" column="id" jdbc-type="BIGINT" primarykey="true" autoincrement="true" />
name="nationId" column="nation_id" jdbc-type="BIGINT" />
name="header" column="header" jdbc-type="VARCHAR" />
name="author" column="author" jdbc-type="VARCHAR" />
name="ownerId" column="item_id" jdbc-type="BIGINT" />
name="changedAt" column="changed_at" jdbc-type="DATE" />
name="textId" column="text_id" jdbc-type="BIGINT" />
name="processId" column="process_id" jdbc-type="BIGINT" />
name="nationality" class-ref="basis.Nationality" auto-retrieve="true" >
name="item" class-ref="basis.ModelItem" auto-retrieve="true" >
My 'modelItems' have a hierarchical structure. Each modelitem knows his parent and holds a collection of its children. Because I don not want to read all modelitems at one time, I have implemented this class as a proxy-class(see datamapping). This means, the ojb implementation should only fill the respective modelitems when I hold a reference of it. It works fine in the JUnitTest I have written. I display this hierarchy in a jtree, using the DefaultMutableTreeNode which contains the modelitems as userObjects. When I additionally try to expand the tree, the ojb implementation is not able to resolve the proxyObjects to real-objects. Therefore it is not possible to display the objecthierarchy in a jtree.
Thanks for helping me
J�rn Ziemke
The error message is :
Used ConnectionManager instance could not obtain a connection: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED]
jcd-alias=oracle
default-connection=true
dbms=Oracle
jdbc-level=1.0
driver=oracle.jdbc.driver.OracleDriver
protocol=jdbc
sub-protocol=oracle
db-alias=thin:@apl.hoppe.de:1526:devB
user=jziemke
password=*****
eager-release=false
ConnectionPoolDescriptor={whenExhaustedAction=0, validationQuery=select count(*) from models, maxIdle=-1, maxActive=1, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, minEvictableIdleTimeMillis=600000, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=true}
batchMode=false
useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
ignoreAutoCommitExceptions=false
[EMAIL PROTECTED]
sequenceManagerClass=class h3.gen.H3SequenceManager
Properties={}
]
]
[org.apache.ojb.broker.accesslayer.IndirectionHandler] ERROR: Method invoking failed for method *getModelItemI18NByNationality* on object null
Used ConnectionManager instance could not obtain a connection: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED]
jcd-alias=oracle
default-connection=true
dbms=Oracle
jdbc-level=1.0
driver=oracle.jdbc.driver.OracleDriver
protocol=jdbc
sub-protocol=oracle
db-alias=thin:@apl.hoppe.de:1526:devB
user=jziemke
password=*****
eager-release=false
ConnectionPoolDescriptor={whenExhaustedAction=0, validationQuery=select count(*) from models, maxIdle=-1, maxActive=1, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, minEvictableIdleTimeMillis=600000, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=true}
batchMode=false
useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
ignoreAutoCommitExceptions=false
[EMAIL PROTECTED]
sequenceManagerClass=class h3.gen.H3SequenceManager
Properties={}
]
]
[org.apache.ojb.broker.accesslayer.IndirectionHandler] ERROR: Method invoking failed for method *getModelItemI18NByNationality* on object unmaterialized proxy for h3.shadow.ModelItem{780730107476194}
null
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
