Re: auto-delete does not work anymore: rc6???

2004-03-30 Thread abo
thank you armin, I will check it out

regards
andreas
Armin Waibel wrote:

Hi again,

the fix is in CVS. Now should the new auto-xxx really backward 
compatible and should be handled in a way described in
http://db.apache.org/ojb/tutorial3.html#1:1%20auto-xxx%20setting

regards,
Armin
Andreas Bohnert wrote:

hi armin,

that was a good suggestion! I don't change the meta data at runtime, 
but it seems that my auto-delete='false' is replaced (because it's 
now deprecated) with an auto-delete='object',
but it should be replaced with 'none'! well, that what I would 
excpect ;)

thats what I got:


   
 
and that is what it should be

 
  

regards
andreas
Armin Waibel wrote:

Hi Andreas,

your code seems ok. Do you manipulate metadata at runtime? Maybe the 
auto-delete flag change at runtime. Can you check this in your 
deleteValidate(...)-method

Collection ords = 
broker.getClassDescriptor(Repository.class).getObjectReferenceDescriptors(); 

for(Iterator iterator = ords.iterator(); iterator.hasNext();)
{
   String str = ((ObjectReferenceDescriptor) iterator.next()).toXML();
   System.out.println(str);
}
and check if the auto-delete is really false (false == 17, true == 23)

regards,
Armin
Andreas Bohnert wrote:

hello armin,

yes, I did replace the repository.dtd.
I just simplified my application source. Here is the client/server 
code that produce the wrong deletes.
I'm using jboss 3.2.3 and postgresql 7.4.1.
the repository files and the database structure is attached.

it's strange, because I think, the ojb junit testcase should cover 
this situation, and it's also strange, that no one else complained
thanks,
andreas

ejb code:
/**
* @ejb:interface-method
*/
   public void deleteValidate(Class dClass, Criteria crit) throws 
Exception {
   PersistenceBroker broker = getBroker();
   Object o = null;
   try {
   Query query = QueryFactory.newQuery( dClass, crit, false 
);  o = broker.getObjectByQuery(query);
   log.debug("object to delete: "+o);
   broker.delete( o );
   } catch (PersistenceBrokerException e) {
   log.error("object could not be deleted: " + o);
   throw new Exception(e);
   }
   broker.close();
   }
  client code:
   public void deleteValidateClient() {
   Criteria crit = new Criteria();
   crit.addEqualTo("institution_contact_id", new 
Integer(1049080));
   try {
   OJBSessionRemote ojb = OjbUtil.getOJBSessionRemote();
   ojb.deleteValidate( Institution_Contact.class, crit );
   } catch (OJBLayerExc e) {
   e.printStackTrace();
   } catch (RemoteException e) {
   e.printStackTrace();
   } catch (Exception e) {
   e.printStackTrace();
   }
   }

this is the resulting spy.log:
1080640877421|15|0|statement|DELETE FROM institution_contact WHERE 
institution_contact_id = ? |DELETE FROM institution_contact WHERE 
institution_contact_id = '1049080'
1080640877421|0|0|statement|DELETE FROM contact WHERE contact_id = 
? |DELETE FROM contact WHERE contact_id = '1049040'
1080640877437|0|0|statement|DELETE FROM institution WHERE 
institution_id = ? |DELETE FROM institution WHERE institution_id = 
'1048857'



 >Hi Andreas,

 >I made a quick test. It works for me. Did you replace the 
repository.dtd?
 >Can you post the source code snip?

 >regards,
 >Armin


Andreas Bohnert wrote:



hello everbody,

today I checked out the rc6 cvs version and did some validation 
tests on my application.
I found out, that there is something going wrong, when I delete an 
object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and 
the CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a 
reason for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







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



 


  
  
  
  
  
  
  

 
  

 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 name="institutionContacts"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Institution_Contact" 

 auto-retrieve="false"
 auto-update="false"
 auto-delete="false"
  >
  
  
  
 name="contactAppResKey"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Contact_AppResKey"
 auto-retrieve="true"
 auto-update="true"
 auto-delete="false"
  >
  
  

  
 name="contactRegions"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Contact_Region"
 auto-retrieve=

Re: auto-delete does not work anymore: rc6???

2004-03-30 Thread Armin Waibel
Hi again,

the fix is in CVS. Now should the new auto-xxx really backward 
compatible and should be handled in a way described in
http://db.apache.org/ojb/tutorial3.html#1:1%20auto-xxx%20setting

regards,
Armin
Andreas Bohnert wrote:
hi armin,

that was a good suggestion! I don't change the meta data at runtime, but 
it seems that my auto-delete='false' is replaced (because it's now 
deprecated) with an auto-delete='object',
but it should be replaced with 'none'! well, that what I would excpect ;)

thats what I got:


   
 
and that is what it should be

 
  

regards
andreas
Armin Waibel wrote:

Hi Andreas,

your code seems ok. Do you manipulate metadata at runtime? Maybe the 
auto-delete flag change at runtime. Can you check this in your 
deleteValidate(...)-method

Collection ords = 
broker.getClassDescriptor(Repository.class).getObjectReferenceDescriptors(); 

for(Iterator iterator = ords.iterator(); iterator.hasNext();)
{
   String str = ((ObjectReferenceDescriptor) iterator.next()).toXML();
   System.out.println(str);
}
and check if the auto-delete is really false (false == 17, true == 23)

regards,
Armin
Andreas Bohnert wrote:

hello armin,

yes, I did replace the repository.dtd.
I just simplified my application source. Here is the client/server 
code that produce the wrong deletes.
I'm using jboss 3.2.3 and postgresql 7.4.1.
the repository files and the database structure is attached.

it's strange, because I think, the ojb junit testcase should cover 
this situation, and it's also strange, that no one else complained
thanks,
andreas

ejb code:
/**
* @ejb:interface-method
*/
   public void deleteValidate(Class dClass, Criteria crit) throws 
Exception {
   PersistenceBroker broker = getBroker();
   Object o = null;
   try {
   Query query = QueryFactory.newQuery( dClass, crit, false 
);  o = broker.getObjectByQuery(query);
   log.debug("object to delete: "+o);
   broker.delete( o );
   } catch (PersistenceBrokerException e) {
   log.error("object could not be deleted: " + o);
   throw new Exception(e);
   }
   broker.close();
   }
  client code:
   public void deleteValidateClient() {
   Criteria crit = new Criteria();
   crit.addEqualTo("institution_contact_id", new Integer(1049080));
   try {
   OJBSessionRemote ojb = OjbUtil.getOJBSessionRemote();
   ojb.deleteValidate( Institution_Contact.class, crit );
   } catch (OJBLayerExc e) {
   e.printStackTrace();
   } catch (RemoteException e) {
   e.printStackTrace();
   } catch (Exception e) {
   e.printStackTrace();
   }
   }

this is the resulting spy.log:
1080640877421|15|0|statement|DELETE FROM institution_contact WHERE 
institution_contact_id = ? |DELETE FROM institution_contact WHERE 
institution_contact_id = '1049080'
1080640877421|0|0|statement|DELETE FROM contact WHERE contact_id = ? 
|DELETE FROM contact WHERE contact_id = '1049040'
1080640877437|0|0|statement|DELETE FROM institution WHERE 
institution_id = ? |DELETE FROM institution WHERE institution_id = 
'1048857'



 >Hi Andreas,

 >I made a quick test. It works for me. Did you replace the 
repository.dtd?
 >Can you post the source code snip?

 >regards,
 >Armin


Andreas Bohnert wrote:



hello everbody,

today I checked out the rc6 cvs version and did some validation 
tests on my application.
I found out, that there is something going wrong, when I delete an 
object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and the 
CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a 
reason for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







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






  
  
  
  
  
  
  

 
  

 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 name="institutionContacts"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Institution_Contact"
 auto-retrieve="false"
 auto-update="false"
 auto-delete="false"
  >
  
  

  
 name="contactAppResKey"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Contact_AppResKey"
 auto-retrieve="true"
 auto-update="true"
 auto-delete="false"
  >
  
  

  
 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 name="institutionRegions"
 
element-class-ref="at.weberhofer.

Re: auto-delete does not work anymore: rc6???

2004-03-30 Thread Armin Waibel
Hi Andreas,

I think you are right, seems auto-delete false/true is not handled 
correct. I will fix this.

regards,
Armin
Andreas Bohnert wrote:

hi armin,

that was a good suggestion! I don't change the meta data at runtime, but 
it seems that my auto-delete='false' is replaced (because it's now 
deprecated) with an auto-delete='object',
but it should be replaced with 'none'! well, that what I would excpect ;)

thats what I got:


   
 
and that is what it should be

 
  

regards
andreas
Armin Waibel wrote:

Hi Andreas,

your code seems ok. Do you manipulate metadata at runtime? Maybe the 
auto-delete flag change at runtime. Can you check this in your 
deleteValidate(...)-method

Collection ords = 
broker.getClassDescriptor(Repository.class).getObjectReferenceDescriptors(); 

for(Iterator iterator = ords.iterator(); iterator.hasNext();)
{
   String str = ((ObjectReferenceDescriptor) iterator.next()).toXML();
   System.out.println(str);
}
and check if the auto-delete is really false (false == 17, true == 23)

regards,
Armin
Andreas Bohnert wrote:

hello armin,

yes, I did replace the repository.dtd.
I just simplified my application source. Here is the client/server 
code that produce the wrong deletes.
I'm using jboss 3.2.3 and postgresql 7.4.1.
the repository files and the database structure is attached.

it's strange, because I think, the ojb junit testcase should cover 
this situation, and it's also strange, that no one else complained
thanks,
andreas

ejb code:
/**
* @ejb:interface-method
*/
   public void deleteValidate(Class dClass, Criteria crit) throws 
Exception {
   PersistenceBroker broker = getBroker();
   Object o = null;
   try {
   Query query = QueryFactory.newQuery( dClass, crit, false 
);  o = broker.getObjectByQuery(query);
   log.debug("object to delete: "+o);
   broker.delete( o );
   } catch (PersistenceBrokerException e) {
   log.error("object could not be deleted: " + o);
   throw new Exception(e);
   }
   broker.close();
   }
  client code:
   public void deleteValidateClient() {
   Criteria crit = new Criteria();
   crit.addEqualTo("institution_contact_id", new Integer(1049080));
   try {
   OJBSessionRemote ojb = OjbUtil.getOJBSessionRemote();
   ojb.deleteValidate( Institution_Contact.class, crit );
   } catch (OJBLayerExc e) {
   e.printStackTrace();
   } catch (RemoteException e) {
   e.printStackTrace();
   } catch (Exception e) {
   e.printStackTrace();
   }
   }

this is the resulting spy.log:
1080640877421|15|0|statement|DELETE FROM institution_contact WHERE 
institution_contact_id = ? |DELETE FROM institution_contact WHERE 
institution_contact_id = '1049080'
1080640877421|0|0|statement|DELETE FROM contact WHERE contact_id = ? 
|DELETE FROM contact WHERE contact_id = '1049040'
1080640877437|0|0|statement|DELETE FROM institution WHERE 
institution_id = ? |DELETE FROM institution WHERE institution_id = 
'1048857'



 >Hi Andreas,

 >I made a quick test. It works for me. Did you replace the 
repository.dtd?
 >Can you post the source code snip?

 >regards,
 >Armin


Andreas Bohnert wrote:



hello everbody,

today I checked out the rc6 cvs version and did some validation 
tests on my application.
I found out, that there is something going wrong, when I delete an 
object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and the 
CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a 
reason for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







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






  
  
  
  
  
  
  

 
  

 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 name="institutionContacts"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Institution_Contact"
 auto-retrieve="false"
 auto-update="false"
 auto-delete="false"
  >
  
  

  
 name="contactAppResKey"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Contact_AppResKey"
 auto-retrieve="true"
 auto-update="true"
 auto-delete="false"
  >
  
  

  
 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 name="institutionRegions"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Institution_Region"
 auto-retrieve="false"
 auto-update="true

Re: auto-delete does not work anymore: rc6???

2004-03-30 Thread Andreas Bohnert
hi armin,

that was a good suggestion! I don't change the meta data at runtime, but 
it seems that my auto-delete='false' is replaced (because it's now 
deprecated) with an auto-delete='object',
but it should be replaced with 'none'! well, that what I would excpect ;)

thats what I got:


   
 
and that is what it should be

 
  

regards
andreas
Armin Waibel wrote:

Hi Andreas,

your code seems ok. Do you manipulate metadata at runtime? Maybe the 
auto-delete flag change at runtime. Can you check this in your 
deleteValidate(...)-method

Collection ords = 
broker.getClassDescriptor(Repository.class).getObjectReferenceDescriptors(); 

for(Iterator iterator = ords.iterator(); iterator.hasNext();)
{
   String str = ((ObjectReferenceDescriptor) iterator.next()).toXML();
   System.out.println(str);
}
and check if the auto-delete is really false (false == 17, true == 23)

regards,
Armin
Andreas Bohnert wrote:

hello armin,

yes, I did replace the repository.dtd.
I just simplified my application source. Here is the client/server 
code that produce the wrong deletes.
I'm using jboss 3.2.3 and postgresql 7.4.1.
the repository files and the database structure is attached.

it's strange, because I think, the ojb junit testcase should cover 
this situation, and it's also strange, that no one else complained
thanks,
andreas

ejb code:
/**
* @ejb:interface-method
*/
   public void deleteValidate(Class dClass, Criteria crit) throws 
Exception {
   PersistenceBroker broker = getBroker();
   Object o = null;
   try {
   Query query = QueryFactory.newQuery( dClass, crit, false 
);  o = broker.getObjectByQuery(query);
   log.debug("object to delete: "+o);
   broker.delete( o );
   } catch (PersistenceBrokerException e) {
   log.error("object could not be deleted: " + o);
   throw new Exception(e);
   }
   broker.close();
   }
  client code:
   public void deleteValidateClient() {
   Criteria crit = new Criteria();
   crit.addEqualTo("institution_contact_id", new Integer(1049080));
   try {
   OJBSessionRemote ojb = OjbUtil.getOJBSessionRemote();
   ojb.deleteValidate( Institution_Contact.class, crit );
   } catch (OJBLayerExc e) {
   e.printStackTrace();
   } catch (RemoteException e) {
   e.printStackTrace();
   } catch (Exception e) {
   e.printStackTrace();
   }
   }

this is the resulting spy.log:
1080640877421|15|0|statement|DELETE FROM institution_contact WHERE 
institution_contact_id = ? |DELETE FROM institution_contact WHERE 
institution_contact_id = '1049080'
1080640877421|0|0|statement|DELETE FROM contact WHERE contact_id = ? 
|DELETE FROM contact WHERE contact_id = '1049040'
1080640877437|0|0|statement|DELETE FROM institution WHERE 
institution_id = ? |DELETE FROM institution WHERE institution_id = 
'1048857'



 >Hi Andreas,

 >I made a quick test. It works for me. Did you replace the 
repository.dtd?
 >Can you post the source code snip?

 >regards,
 >Armin


Andreas Bohnert wrote:



hello everbody,

today I checked out the rc6 cvs version and did some validation 
tests on my application.
I found out, that there is something going wrong, when I delete an 
object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and the 
CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a 
reason for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







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






  
  
  
  
  
  
  

 
  

 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 name="institutionContacts"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Institution_Contact"
 auto-retrieve="false"
 auto-update="false"
 auto-delete="false"
  >
  
  

  
 name="contactAppResKey"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Contact_AppResKey"
 auto-retrieve="true"
 auto-update="true"
 auto-delete="false"
  >
  
  

  
 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 name="institutionRegions"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Institution_Region"
 auto-retrieve="false"
 auto-update="true"
 auto-delete="false"
 >
 
  

  
 name="institutionContacts"
 
element-class-ref="at.weberhofer.eusoda.shared.orm.Ins

Re: auto-delete does not work anymore: rc6???

2004-03-30 Thread Armin Waibel
Hi Andreas,

your code seems ok. Do you manipulate metadata at runtime? Maybe the 
auto-delete flag change at runtime. Can you check this in your 
deleteValidate(...)-method

Collection ords = 
broker.getClassDescriptor(Repository.class).getObjectReferenceDescriptors();
for(Iterator iterator = ords.iterator(); iterator.hasNext();)
{
   String str = ((ObjectReferenceDescriptor) iterator.next()).toXML();
   System.out.println(str);
}

and check if the auto-delete is really false (false == 17, true == 23)

regards,
Armin
Andreas Bohnert wrote:

hello armin,

yes, I did replace the repository.dtd.
I just simplified my application source. Here is the client/server code 
that produce the wrong deletes.
I'm using jboss 3.2.3 and postgresql 7.4.1.
the repository files and the database structure is attached.

it's strange, because I think, the ojb junit testcase should cover this 
situation, and it's also strange, that no one else complained
thanks,
andreas

ejb code:
/**
* @ejb:interface-method
*/
   public void deleteValidate(Class dClass, Criteria crit) throws 
Exception {
   PersistenceBroker broker = getBroker();
   Object o = null;
   try {
   Query query = QueryFactory.newQuery( dClass, crit, false 
);  o = broker.getObjectByQuery(query);
   log.debug("object to delete: "+o);
   broker.delete( o );
   } catch (PersistenceBrokerException e) {
   log.error("object could not be deleted: " + o);
   throw new Exception(e);
   }
   broker.close();
   }
  client code:
   public void deleteValidateClient() {
   Criteria crit = new Criteria();
   crit.addEqualTo("institution_contact_id", new Integer(1049080));
   try {
   OJBSessionRemote ojb = OjbUtil.getOJBSessionRemote();
   ojb.deleteValidate( Institution_Contact.class, crit );
   } catch (OJBLayerExc e) {
   e.printStackTrace();
   } catch (RemoteException e) {
   e.printStackTrace();
   } catch (Exception e) {
   e.printStackTrace();
   }
   }

this is the resulting spy.log:
1080640877421|15|0|statement|DELETE FROM institution_contact WHERE 
institution_contact_id = ? |DELETE FROM institution_contact WHERE 
institution_contact_id = '1049080'
1080640877421|0|0|statement|DELETE FROM contact WHERE contact_id = ? 
|DELETE FROM contact WHERE contact_id = '1049040'
1080640877437|0|0|statement|DELETE FROM institution WHERE institution_id 
= ? |DELETE FROM institution WHERE institution_id = '1048857'



 >Hi Andreas,

 >I made a quick test. It works for me. Did you replace the repository.dtd?
 >Can you post the source code snip?
 >regards,
 >Armin


Andreas Bohnert wrote:



hello everbody,

today I checked out the rc6 cvs version and did some validation tests 
on my application.
I found out, that there is something going wrong, when I delete an 
object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and the 
CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a 
reason for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







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






  
  
  
  
  
  
  

 
  

 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
  
  
  
  
  
  
 
  



  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
 
  
  
  
  




CREATE TABLE institution (
institution_id integer DEFAULT 0 NOT NULL,
topinstitution_id integer DEFAULT 0 NOT NULL,
umbrellainstitution_id integer DEFAULT 0 NOT NULL,
createcontact_id integer DEFAULT 0 NOT NULL,
updatecontact_id integer DEFAULT 0 NOT NULL,
instdescuserreskey_id integer DEFAULT 0 NOT NULL,
businesshoursuserreskey_id integer DEFAULT 0 NOT NULL,
insttypeappreskey_id integer DEFAULT 0 NOT NULL,
institution1 character varying(120) DEFAULT ''::character varying NOT NULL,
institution2 character varying(120) DEFAULT ''::character varying NOT NULL,
ispublic smallint DEFAULT (1)::smallint NOT NULL,
infointernal character varying(255) DEFAULT ''::character varying NOT NULL,
foundationdate timestamp without time zone DEFAULT '0001-01-01 
00:00:00'::timestamp without time zone,
sorthelp smallint DEFAULT (0)::smallint NOT NULL,
isumbrella smallint DEFAULT (0)::smallint NOT NULL,
isremoved smallint DEFAULT (0)::smallint NOT NULL,
   

Re: auto-delete does not work anymore: rc6???

2004-03-30 Thread Andreas Bohnert
hello armin,

yes, I did replace the repository.dtd.
I just simplified my application source. Here is the client/server code 
that produce the wrong deletes.
I'm using jboss 3.2.3 and postgresql 7.4.1.
the repository files and the database structure is attached.

it's strange, because I think, the ojb junit testcase should cover this 
situation, and it's also strange, that no one else complained
thanks,
andreas

ejb code:
/**
* @ejb:interface-method
*/
   public void deleteValidate(Class dClass, Criteria crit) throws 
Exception {
   PersistenceBroker broker = getBroker();
   Object o = null;
   try {
   Query query = QueryFactory.newQuery( dClass, crit, false 
);   
   o = broker.getObjectByQuery(query);
   log.debug("object to delete: "+o);
   broker.delete( o );
   } catch (PersistenceBrokerException e) {
   log.error("object could not be deleted: " + o);
   throw new Exception(e);
   }
   broker.close();
   }
  
client code:
   public void deleteValidateClient() {
   Criteria crit = new Criteria();
   crit.addEqualTo("institution_contact_id", new Integer(1049080));
   try {
   OJBSessionRemote ojb = OjbUtil.getOJBSessionRemote();
   ojb.deleteValidate( Institution_Contact.class, crit );
   } catch (OJBLayerExc e) {
   e.printStackTrace();
   } catch (RemoteException e) {
   e.printStackTrace();
   } catch (Exception e) {
   e.printStackTrace();
   }
   }

this is the resulting spy.log:
1080640877421|15|0|statement|DELETE FROM institution_contact WHERE 
institution_contact_id = ? |DELETE FROM institution_contact WHERE 
institution_contact_id = '1049080'
1080640877421|0|0|statement|DELETE FROM contact WHERE contact_id = ? 
|DELETE FROM contact WHERE contact_id = '1049040'
1080640877437|0|0|statement|DELETE FROM institution WHERE institution_id 
= ? |DELETE FROM institution WHERE institution_id = '1048857'



>Hi Andreas,

>I made a quick test. It works for me. Did you replace the repository.dtd?
>Can you post the source code snip?
>regards,
>Armin


Andreas Bohnert wrote:



hello everbody,

today I checked out the rc6 cvs version and did some validation tests 
on my application.
I found out, that there is something going wrong, when I delete an 
object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and the 
CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a 
reason for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







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



  
  
  
  
  
  
  


 
  


 
  






  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

  
 
  

  
 
  

  
  
  

  
  
  

  
 
  




  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

  
 
  

  
 
  

  
 
  

  
 
  

  
 
  

  
 
  

  
  
  


CREATE TABLE institution (
institution_id integer DEFAULT 0 NOT NULL,
topinstitution_id integer DEFAULT 0 NOT NULL,
umbrellainstitution_id integer DEFAULT 0 NOT NULL,
createcontact_id integer DEFAULT 0 NOT NULL,
updatecontact_id integer DEFAULT 0 NOT NULL,
instdescuserreskey_id integer DEFAULT 0 NOT NULL,
businesshoursuserreskey_id integer DEFAULT 0 NOT NULL,
insttypeappreskey_id integer DEFAULT 0 NOT NULL,
institution1 character varying(120) DEFAULT ''::character varying NOT NULL,
institution2 character varying(120) DEFAULT ''::character varying NOT NULL,
ispublic smallint DEFAULT (1)::smallint NOT NULL,
infointernal character varying(255) DEFAULT ''::character varying NOT NULL,
foundationdate timestamp without time zone DEFAULT '0001-01-01 
00:00:00'::timestamp without time zone,
sorthelp smallint DEFAULT (0)::smallint NOT NULL,
isumbrella smallint DEFAULT (0)::smallint NOT NULL,
isremoved smallint DEFAULT (0)::smallint NOT NULL,
createtime timestamp without time zone DEFAULT '0001-01-01 00:00:00'::timestamp 
without time zone NOT NULL,
updatetime timestamp without time zone DEFAULT '0001-01-01 00:00:00'::timestamp 
without time zone NOT NULL
);

ALTER TABLE ONLY institution
ADD CONSTRAINT institution_pkey PRIMARY KEY (institution_id);




CREATE TABLE contact (
contact_id integer DEFAULT 0 NOT NULL,
descuserreskey_id integer DEFAULT 0 NOT NULL,
updatecontact_id integer DEFAULT 0 NOT NULL,
genderappreskey_id integer DEFAULT 0 NOT NULL,
salutation character varying(80) DEFAULT ''::character varying NOT NULL,
academictitle character varying(80) DEFAULT ''::character va

Re: auto-delete does not work anymore: rc6???

2004-03-29 Thread Armin Waibel
Hi Andreas,

I made a quick test. It works for me. Did you replace the repository.dtd?
Can you post the source code snip?
regards,
Armin
Andreas Bohnert wrote:


hello everbody,

today I checked out the rc6 cvs version and did some validation tests on 
my application.
I found out, that there is something going wrong, when I delete an object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and the 
CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a reason 
for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







-
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]


auto-delete does not work anymore: rc6???

2004-03-29 Thread Andreas Bohnert


hello everbody,

today I checked out the rc6 cvs version and did some validation tests on 
my application.
I found out, that there is something going wrong, when I delete an object.

I have an decomposed n-m relation:

CONTACT INSTITUTION_CONTACT --- INSTITUTION

when I delete an INSTITUTION_CONTACT the related INSTITUTION and the 
CONTACT are deleted as well!!
I have put an auto-delete=false in my metadata, so I don't see a reason 
for that action.

here is the metadata for INSTITUTION_CONTACT :
class-descriptor
class="at.weberhofer.eusoda.shared.orm.Institution_Contact"
table="institution_contact"








  
   

  
   







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