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 Joose Vettenranta <jo...@iki.fi> on 2004/07/24 11:05:09 UTC

Is this a bug?

Hi,

like you have seen, I've tried and tried to make 1:n mapping to work.

Now I did exactly how tutorials and docs showed but still it's not 
working correctly. I used <collection-descriptor> and 
<reference-descriptor> just like showed in docs/howto's/tutorial but 
still no luck. It seems that it doesn't care in which order it inserts 
/ deletes stuff from database => BUG?

It seems to execute sql-clauses in somewhat random order. I have set up 
webpage to what I did and what was the result.

Webpage is http://joose.iki.fi/ojb/

ojb is 1.0.rc6

Could this be a bug or is this just feature not yet supported?

Can I somehow make it manually to retrieve/delete in correct order?

Thanks, Joose

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Is this a bug?

Posted by Joose Vettenranta <jo...@iki.fi>.
That sounds interesting..

I never got to DELETE to go that far, so I really don't know.

I think my original DAO had problem with not understunding relations.. 
Maybe it was a JDO thing and not told in JDO that there is relation - 
but I didn't find any good documentation about JDO. This PBApi seems to 
work ok for insert/update/delete .. I'm trying now to do select.

Thanks,

Joose

24.7.2004 kello 14:37, Jakob Braeuchi kirjoitti:

  hi joose,
>
> yes PBApi is PersistenceBroker-API. PBApi is the low-level api and 
> thus it does not provide the advanced stufff of otm and jdo.
>
> btw. when using your old dao i do have a problem in remove(). the two 
> children are deleted as expected but the second one is added again ?!
>
--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Is this a bug?

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi joose,

yes PBApi is PersistenceBroker-API. PBApi is the low-level api and thus it does 
not provide the advanced stufff of otm and jdo.

btw. when using your old dao i do have a problem in remove(). the two children 
are deleted as expected but the second one is added again ?!

jakob

Joose Vettenranta schrieb:

> Well, it might have been..
> 
> I don't know what you ment with PbApi, so I think you were refeerring to 
> PersistenceBroker .. So I wrote DAO again using only that and guess what..
> 
> it seems to work.. I updated my test script to do UPDATE also and did a 
> for-loop of repeating those for 100 times.. Seems to work!
> 
> So there was nothing wrong with my mappings or anything, it was the DAO 
> thingie which was broken.
> 
> 
> 24.7.2004 kello 14:03, Jakob Braeuchi kirjoitti:
> 
>> the PbApi hint was not too useful for you i think ;)
>>
>> anyway i was playing with your sample a little bit and found some 
>> issues. i have to admit that i'm neither an otm- nor a jdo-crack, so 
>> there may be better solutions.
>>
>> - the collection descriptor in parent should be defined 
>> otm-dependent="true".
> 
> 
> I actually removed that and put auto-retrieve="yes" auto-update="yes" 
> and auto-remove="yes" and seems to work
> 
>> - the pk of child must NOT be readonly.
> 
> 
> you are right, because if it's readonly, then when inserting, it will 
> create new primarykey for that entry = bad
> 
> Thanks for the help,
> 
> Joose
> 
> ps. I'll upgrade my webpage soon to have current working setting so you 
> can evaluate if it's good enough for perhaps some example of 1:n mapping?
> 
> -- 
> "Always remember that you are unique, just like everyone else!"
> * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Is this a bug?

Posted by Joose Vettenranta <jo...@iki.fi>.
Well, it might have been..

I don't know what you ment with PbApi, so I think you were refeerring 
to PersistenceBroker .. So I wrote DAO again using only that and guess 
what..

it seems to work.. I updated my test script to do UPDATE also and did a 
for-loop of repeating those for 100 times.. Seems to work!

So there was nothing wrong with my mappings or anything, it was the DAO 
thingie which was broken.


24.7.2004 kello 14:03, Jakob Braeuchi kirjoitti:
> the PbApi hint was not too useful for you i think ;)
>
> anyway i was playing with your sample a little bit and found some 
> issues. i have to admit that i'm neither an otm- nor a jdo-crack, so 
> there may be better solutions.
>
> - the collection descriptor in parent should be defined 
> otm-dependent="true".

I actually removed that and put auto-retrieve="yes" auto-update="yes" 
and auto-remove="yes" and seems to work

> - the pk of child must NOT be readonly.

you are right, because if it's readonly, then when inserting, it will 
create new primarykey for that entry = bad

Thanks for the help,

Joose

ps. I'll upgrade my webpage soon to have current working setting so you 
can evaluate if it's good enough for perhaps some example of 1:n 
mapping?

--
"Always remember that you are unique, just like everyone else!"
* http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Is this a bug?

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi joose,

the PbApi hint was not too useful for you i think ;)

anyway i was playing with your sample a little bit and found some issues. i have 
to admit that i'm neither an otm- nor a jdo-crack, so there may be better solutions.

- the collection descriptor in parent should be defined otm-dependent="true".
- the pk of child must NOT be readonly.

this is the resulting sql for the insert:

SELECT NAME,PARENT_ID,ID FROM nv_CHILDS WHERE ID = '21'
SELECT NAME,PARENT_ID,ID FROM nv_CHILDS WHERE ID = '22'
INSERT INTO nv_PARENT (ID,NAME) VALUES ('262','Dad 1')
INSERT INTO nv_CHILDS (ID,PARENT_ID,NAME) VALUES ('21','262','Child 1')
INSERT INTO nv_CHILDS (ID,PARENT_ID,NAME) VALUES ('22','262','Child 2')


hth
jakob


Jakob Braeuchi schrieb:

> hi joose,
> 
> have you tried the PBApi instead ?
> 
> jakob
> 
> Joose Vettenranta schrieb:
> 
>> Hi,
>>
>> like you have seen, I've tried and tried to make 1:n mapping to work.
>>
>> Now I did exactly how tutorials and docs showed but still it's not 
>> working correctly. I used <collection-descriptor> and 
>> <reference-descriptor> just like showed in docs/howto's/tutorial but 
>> still no luck. It seems that it doesn't care in which order it inserts 
>> / deletes stuff from database => BUG?
>>
>> It seems to execute sql-clauses in somewhat random order. I have set 
>> up webpage to what I did and what was the result.
>>
>> Webpage is http://joose.iki.fi/ojb/
>>
>> ojb is 1.0.rc6
>>
>> Could this be a bug or is this just feature not yet supported?
>>
>> Can I somehow make it manually to retrieve/delete in correct order?
>>
>> Thanks, Joose
>>
>> -- 
>> "Always remember that you are unique, just like everyone else!"
>> * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Is this a bug?

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi joose,

have you tried the PBApi instead ?

jakob

Joose Vettenranta schrieb:
> Hi,
> 
> like you have seen, I've tried and tried to make 1:n mapping to work.
> 
> Now I did exactly how tutorials and docs showed but still it's not 
> working correctly. I used <collection-descriptor> and 
> <reference-descriptor> just like showed in docs/howto's/tutorial but 
> still no luck. It seems that it doesn't care in which order it inserts / 
> deletes stuff from database => BUG?
> 
> It seems to execute sql-clauses in somewhat random order. I have set up 
> webpage to what I did and what was the result.
> 
> Webpage is http://joose.iki.fi/ojb/
> 
> ojb is 1.0.rc6
> 
> Could this be a bug or is this just feature not yet supported?
> 
> Can I somehow make it manually to retrieve/delete in correct order?
> 
> Thanks, Joose
> 
> -- 
> "Always remember that you are unique, just like everyone else!"
> * http://iki.fi/joose/ * joose@iki.fi * +358 44 561 0270 *
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org