Hello!
I have a little more complex problem when inserting objects. I'm not sure
wheter it has to do with my primary keys (some anonymous) or maybe with the
sequence manager or cache I'm using. I'll try to describe:
I have a class ServerVO with an entryID (implemented already in that class).
It has a 1:1 association (reference descriptor) to the class ModulesVO.
ModulesVO holds a List (1:n) of classes of the type ModuleVO which has
already implemented an moduleId. ModuleVO is extended by three further
classes (PingModuleVO, HtppModuleVO, RmiModuleVO). It looks like this:
---------------
| ServerVO |
| int entryId |
---------------
|1
|
|1
------------
| ModulesVO |
-------------
|1
|
|n
----------------
| ModuleVO |
| int moduleId |
----------------
|
-----------------------
| | |
---------- ---------- ---------
| PingVO | | HttpVO | | RmiVO |
---------- ---------- ---------
I have entered in my repository an anonymous field as PK for ModulesVO
(autoincrement="true" primarykey="true" access="anonymous", see repository
below). But it does not increment in the way I expect.
The first stored entry works fine. ModulesVO gets the annonymous id '0'
(referenced in ServerVO). When I want to store the next entry there is only
created an SQL statement that inserts a row for my ServerVO but nothing more
(not for ModulesVO and so on). This next entry gets also a reference to the
same ModulesVO as before!! I never get more then one entry in the table
ModulesVO!
But the strange thing is, that the table content does not correspond with
the content I get when I look it up with a query! That means OJB shows me
content that isn't in the database! Of cause not if I restart my apllication
server. Then the entered data is lost. I also tried to change the cache from
ObjectCacheDefaultImpl to ObjectCacheEmptyImpl but that didn't change a
thing! I hope it is something simple. Or maybe my repository is wrong or the
Sequence manager I'm using? I hope I explained everything comprehensible.
Julia.
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="MySQL"
jdbc-level="2.0"
jndi-datasource-name="java:DemoAppsDB"
username="monitor"
password="password"
eager-release="false"
batch-mode="false"
useAutoCommit="2"
ignoreAutoCommitExceptions="false">
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerMySQLImpl"/>
</jdbc-connection-descriptor>
<class-descriptor
class="de.arvatosystems.monitoring.business.vo.server.ServerVO"
table="SERVERVO">
<field-descriptor name="entryId" column="ID" jdbc-type="INTEGER"
primarykey="true" autoincrement="false"/>
<field-descriptor name="locale" column="LOCALE" jdbc-type="VARCHAR"
primarykey="true" autoincrement="false"/>
/* some attributes */
<field-descriptor name="modulesId" column="MODULESID"
jdbc-type="INTEGER" primarykey="true"
autoincrement="true" access="anonymous"/>
<reference-descriptor name="modules"
class-ref="de.arvatosystems.monitoring.business.vo.module.ModulesVO">
<foreignkey field-ref="modulesId"/>
</reference-descriptor>
</class-descriptor>
<class-descriptor
class="de.arvatosystems.monitoring.business.vo.module.ModulesVO"
table="MODULESVO">
<field-descriptor name="Id" column="ID" jdbc-type="INTEGER"
autoincrement="true" primarykey="true" access="anonymous"/>
<collection-descriptor name="modules"
element-class-ref="de.arvatosystems.monitoring.business.vo.module.ModuleVO"
orderby="moduleId" sort="ASC">
<inverse-foreignkey field-ref="Id"/>
</collection-descriptor>
</class-descriptor>
<class-descriptor
class="de.arvatosystems.monitoring.business.vo.module.ModuleVO"
table="MODULEVO">
<extent-class
class-ref="de.arvatosystems.monitoring.business.vo.module.PingModuleVO"/>
<extent-class
class-ref="de.arvatosystems.monitoring.business.vo.module.HttpModuleVO"/>
<extent-class
class-ref="de.arvatosystems.monitoring.business.vo.module.RmiModuleVO"/>
<field-descriptor name="Id" column="ENTRYID" jdbc-type="INTEGER"
access="anonymous"
primarykey="true" autoincrement="true"/>
<field-descriptor name="moduleId" column="MODULEID"
jdbc-type="INTEGER" primarykey="true" autoincrement="false"/>
/* some attributes */
</class-descriptor>
<class-descriptor
class="de.arvatosystems.monitoring.business.vo.module.PingModuleVO"
table="PINGMODULEVO">
<field-descriptor name="Id" column="ENTRYID" jdbc-type="INTEGER"
access="anonymous"
primarykey="true" autoincrement="true"/>
<field-descriptor name="moduleId" column="MODULEID"
jdbc-type="INTEGER" primarykey="true" autoincrement="false"/>
/* some attributes */
</class-descriptor>
<class-descriptor
class="de.arvatosystems.monitoring.business.vo.module.HttpModuleVO"
table="HTTPMODULEVO">
<field-descriptor name="Id" column="ENTRYID" jdbc-type="INTEGER"
access="anonymous"
primarykey="true" autoincrement="true"/>
<field-descriptor name="moduleId" column="MODULEID"
jdbc-type="INTEGER" primarykey="true" autoincrement="false"/>
/* some attributes */
</class-descriptor>
<class-descriptor
class="de.arvatosystems.monitoring.business.vo.module.RmiModuleVO"
table="RMIMODULEVO">
<field-descriptor name="Id" column="ENTRYID" jdbc-type="INTEGER"
access="anonymous"
primarykey="true" autoincrement="true"/>
<field-descriptor name="moduleId" column="MODULEID"
jdbc-type="INTEGER" primarykey="true" autoincrement="false"/>
/* some attributes */
</class-descriptor>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]