Hi Josef,

could you post the mapping for 'Rollen' too and a code snippet how you are store 'Gruppen'. Then I can try to reproduce your problem.

regards,
Armin

Josef Wagner wrote:
Hi,

here an example of my DELETE and INSERT problem (OJB 1.0.3):
##################
# repository.xml #
##################
<class-descriptor class="de.on_ergy.lakon.data.model.Gruppen" table="gruppen"> <field-descriptor name="objId" column="obj_id" jdbc-type="INTEGER" primarykey="true" autoincrement="true">
    </field-descriptor>
        .....

    <!-- m - n width gruppen_rollen to rollen -->
    <collection-descriptor
      name="rollen"
      collection-
      class="org.apache.ojb.broker.util.collections.ManageableArrayList"
      element-class-ref="de.on_ergy.lakon.data.model.Rollen"
      auto-retrieve="true"
      auto-update="object"
      auto-delete="link"
      proxy="true"
      indirection-table="gruppen_rollen">

     <fk-pointing-to-this-class column="gruppen_obj_id"/>
     <fk-pointing-to-element-class column="rollen_obj_id"/>
</collection-descriptor>
</class-descriptor>

############################################################################
# output in HSQL LOG when saving the Gruppe width allready existing Rollen #
############################################################################
INSERT INTO GRUPPEN VALUES(3,'SYSADMIN',NULL,NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=1
INSERT INTO ROLLEN VALUES(1,'BENUTZERVERW',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=2
INSERT INTO ROLLEN VALUES(2,'VWARTEN',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=3
INSERT INTO ROLLEN VALUES(3,'TSTAVERW',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=4
INSERT INTO ROLLEN VALUES(4,'EINSVERW',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=5
INSERT INTO ROLLEN VALUES(5,'TEILELOESCH',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=6
INSERT INTO ROLLEN VALUES(6,'PROJVERW',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=7
INSERT INTO ROLLEN VALUES(7,'KONTRKM',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=8
INSERT INTO ROLLEN VALUES(8,'KONTRRHTH',NULL)
DELETE FROM ROLLEN WHERE OBJ_ID=9
INSERT INTO ROLLEN VALUES(9,'VERWAEND',NULL)
INSERT INTO ROLLEN VALUES(10,'VERWLOESCH',NULL)

---

INSERT INTO GRUPPEN_ROLLEN VALUES(3,1)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,2)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,3)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,4)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,5)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,6)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,7)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,8)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,9)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,10)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,11)
INSERT INTO GRUPPEN_ROLLEN VALUES(3,12)

What is OJB doing in the first part of the log (DELETE, INSERT...)? Is there
a problem in my repository.xml?

Thanks a lot for your help!
Josef



-----Ursprüngliche Nachricht-----
Von: Josef Wagner [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 10. Mai 2006 08:49
An: 'OJB Users List'
Betreff: AW: OJB do delete and insert instead of update

Hi Armin, I'm working with OJB 1.0.3.
Sorry, I have debugged again and see that m-n-handling is ok.
Delete and insert instead of updating takes only affect by updating the
primitive attributes of an object, not in the m-n relation tables.

regards
Josef


Hi Josef,

Josef Wagner wrote:
Hello list,

why does ojb delete and insert when I'm updating an existing entry?

Isn't this way negative in view of performance?

I've seen this concept also by updating m-n relations.


Which version of OJB do you use?
Beside the update of m-n relations when does OJB "delete and insert" instead of a simply update? Could you describe more detailed?

regards,
Armin


Thanks for your answers

Josef Wagner, Germany



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to