Derby on OJB?

2005-05-31 Thread Robert S. Sfeir

Hey

Has anyone successfully gotten Derby to work with OJB, and if so what  
platform did you use to specify OJB to use?


I have it set to DB2 right now, but I'm not getting any love from it,  
OJB is complaining that the schema does not exist, but in my little  
test JSP it indeed does exist and works when I connect directly using  
a Connection.


Thanks
R

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



Re: Tomcat 5.5.9 and OJB?

2005-04-20 Thread Robert S. Sfeir
On Apr 20, 2005, at 7:01 PM, [EMAIL PROTECTED] wrote:
java.lang.NoClassDefFoundError: org/apache/commons/dbcp/ 
AbandonedConfig
Do you have the wrong version of commons dbcp?  Or perhaps does  
Tomcat 5.5.9 include one by default and it's colliding with what OJB  
is expecting?

R
Robert S. Sfeir
robert(at)codepuccinoNOSPAM.com
"Make everything as simple as possible,
but not simpler" - Einstein
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: status on 1.02 release?

2005-03-24 Thread Robert S. Sfeir
Brian is working on the release as we speak.
R
On Mar 24, 2005, at 12:08 PM, Ryan Vanderwerf wrote:
Just checking if anyone knows the target date for 1.02? I am  
looking to
upgrade but am afraid of the cache problem in 1.01.


Ryan

!DSPAM:42434831247681776579306!
Robert S. Sfeir
robert(at)codepuccinoNOSPAM.com
"Make everything as simple as possible,
but not simpler" - Einstein
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-08 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Feb 8, 2005, at 2:06 PM, Jakob Braeuchi wrote:
hi robert,
imo this behaviour is not specific to child objects. i would also 
expect it when using getCollectionByQuery with a 'non-sortable' 
collection class.
so i think we'd better document it.

Hum I have a few of those, and I don't see the behavior, weird.  OK 
better document for sure...  problem is often folks won't read docs, I 
was thinking a more blunt approach might get their attention :-)

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCCRmcJhqny0eCHK8RAhbkAJ4kqFNJk6HbKP6YOfHQB3h29/Z9cQCghtl0
H8EGGemCoo0IjpgMOkGlBm0=
=x8nO
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-08 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Feb 8, 2005, at 9:33 AM, Christoph Hermann wrote:
 ObjectCachePerBrokerImpl
now its working fine (until i get a problem with that ;-)).
You wouldn't be using Spring Framework by any chance?  I did that 
because Spring requires it as well.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCCNnaJhqny0eCHK8RAopwAJsHLpfuf2/z5VBFxRvyYMaACgwQ5wCcCRkh
JIHFyFal+vuNAO9ZwL/4gl8=
=81A9
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-08 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Feb 8, 2005, at 7:16 AM, Christoph Hermann wrote:
I have a similar Problem (i think).
When retrieving a Collection for the first time, the order is fine like
i want it.
When retrieving it a second or third, or ... time i seem to get a 
random
order.
My disordering is consistently ordered by record ID.  So it's not out 
of order, just not the order I'm telling it to orderby.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCCMSDJhqny0eCHK8RApICAJ4gjEWsxIcn6s3r5tm7pcfWtP4HHgCeKEt6
eojTr+KCFnjN+bHFcjT7Xzo=
=AsKJ
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-07 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Steps 1.) and 2.) are imo ok. the sql contains an order by and 
ArrayList  also maintains the order.
The problem is in step 3.) how could we warn the user that his list 
may cause sorting problems ?
Yup exactly what I was originally thinking, I do think however that we 
can just change from a HashSet to a SortedSet, then the ArrayList and 
*Set Impl will work.  HashSet is fine for speed I guess if there is no 
ordering.  So maybe we check to see if we have orderedby and get a 
SortedSet, if not HashSet.  Then document behavior?  If not possible, 
then definitely throw an exception to get the user's attention.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB9+tJhqny0eCHK8RAhi5AJ4jyv7T1FqX1op3GJDUcB+IVCD9vgCdFLBf
oWyJ2aSiuWC9FVN9aBi1qH8=
=wf8c
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-07 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
OOPS make that SortedSet, Tree set won't do it either
On Feb 7, 2005, at 4:33 PM, Robert S. Sfeir wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Armin,
I think the issue might be that we're using a HashSet not an 
OrderedSet or as Brian suggested TreeSet.

it seems that in general in OJB we should be using sorable sets, 
though hash is faster of course, because of the nature of the purpose.

R
On Feb 7, 2005, at 4:23 PM, Robert S. Sfeir wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Feb 7, 2005, at 4:03 PM, Jakob Braeuchi wrote:
hi robert,
i added a simple testcase QueryTest#testPrefetchedCollectionOrderBy 
that uses the orderby attribute of the CollectionDescriptor.
this test passes without any problems.
The only potential problem i see is in 
ColllectionPrefetcher#associateBatched().
...
  else
   {
   ManageableCollection col = 
createCollection(collectionClass);
   for (Iterator it2 = list.iterator(); it2.hasNext();)
   {
   col.ojbAdd(it2.next());
   }
   result = col;
   }
...
if the collectionClass of CollectionDescriptor does not maintain the 
order the we have a problem.
Yup that looks like it, I use ManageableCollection, specifically the 
Set impl but changed to ArrayList impl, it's relying on the 
Collection to maintain its natural order, hence if the Collection is 
not sortable, it just adds them as it gets them. (at least this is 
what I understand from the code).  Something has to happen there to 
tell the user they're full of it, and that you can't sort.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB9xEJhqny0eCHK8RAjohAJ4srmUKZ+FpWe6n1mKxjzf0HH/VYwCaA1jZ
kIUY2hDxVeTCadrHpy7KNbI=
=BiF0
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB97HJhqny0eCHK8RAmQgAJ9EYCUdwjYuGW0lPwQ960x8l8L/6wCffYmR
YsR4f7d2BMbqtRpmqp7rTaU=
=7QPO
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB98QJhqny0eCHK8RAhuqAJ9ATlwArcQrjGrhizSvutDSxBHH/gCfQCgy
ygtF5NuOZ3NaElAqvL7b7KQ=
=cgb5
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-07 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Armin,
I think the issue might be that we're using a HashSet not an OrderedSet 
or as Brian suggested TreeSet.

it seems that in general in OJB we should be using sorable sets, though 
hash is faster of course, because of the nature of the purpose.

R
On Feb 7, 2005, at 4:23 PM, Robert S. Sfeir wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Feb 7, 2005, at 4:03 PM, Jakob Braeuchi wrote:
hi robert,
i added a simple testcase QueryTest#testPrefetchedCollectionOrderBy 
that uses the orderby attribute of the CollectionDescriptor.
this test passes without any problems.
The only potential problem i see is in 
ColllectionPrefetcher#associateBatched().
...
  else
   {
   ManageableCollection col = 
createCollection(collectionClass);
   for (Iterator it2 = list.iterator(); it2.hasNext();)
   {
   col.ojbAdd(it2.next());
   }
   result = col;
   }
...
if the collectionClass of CollectionDescriptor does not maintain the 
order the we have a problem.
Yup that looks like it, I use ManageableCollection, specifically the 
Set impl but changed to ArrayList impl, it's relying on the Collection 
to maintain its natural order, hence if the Collection is not 
sortable, it just adds them as it gets them. (at least this is what I 
understand from the code).  Something has to happen there to tell the 
user they're full of it, and that you can't sort.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB9xEJhqny0eCHK8RAjohAJ4srmUKZ+FpWe6n1mKxjzf0HH/VYwCaA1jZ
kIUY2hDxVeTCadrHpy7KNbI=
=BiF0
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB97HJhqny0eCHK8RAmQgAJ9EYCUdwjYuGW0lPwQ960x8l8L/6wCffYmR
YsR4f7d2BMbqtRpmqp7rTaU=
=7QPO
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-07 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Feb 7, 2005, at 4:03 PM, Jakob Braeuchi wrote:
hi robert,
i added a simple testcase QueryTest#testPrefetchedCollectionOrderBy 
that uses the orderby attribute of the CollectionDescriptor.
this test passes without any problems.
The only potential problem i see is in 
ColllectionPrefetcher#associateBatched().
...
  else
   {
   ManageableCollection col = 
createCollection(collectionClass);
   for (Iterator it2 = list.iterator(); it2.hasNext();)
   {
   col.ojbAdd(it2.next());
   }
   result = col;
   }
...
if the collectionClass of CollectionDescriptor does not maintain the 
order the we have a problem.
Yup that looks like it, I use ManageableCollection, specifically the 
Set impl but changed to ArrayList impl, it's relying on the Collection 
to maintain its natural order, hence if the Collection is not sortable, 
it just adds them as it gets them. (at least this is what I understand 
from the code).  Something has to happen there to tell the user they're 
full of it, and that you can't sort.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB9xEJhqny0eCHK8RAjohAJ4srmUKZ+FpWe6n1mKxjzf0HH/VYwCaA1jZ
kIUY2hDxVeTCadrHpy7KNbI=
=BiF0
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-07 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Feb 7, 2005, at 11:52 AM, Jakob Braeuchi wrote:
hi robert,
Robert S. Sfeir schrieb:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Yeah I know, I was avoiding the query customizer didn't want to make 
it  that specific for this particular need, your suggestion of 
orderby  turned out to be the perfect solution.  That said, the 
orderby in the  collection-descriptor doesn't order anything if the 
collection is not  sortable.
that's strange. afaik orderby is only handled in the generated sql ??
does ojb at least include 'order by' in the sql ?
Not that I could see in child objects, which is why I think it's 
affected after the select happens using Collections.sort(...).

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB55mJhqny0eCHK8RAjTMAJ0ddp+xgzh/yYz8Jyk9zcE4S6UJbgCeId3D
STOb3QdpeEPrdW2K6k0opzE=
=aJ9L
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-07 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Yeah I know, I was avoiding the query customizer didn't want to make it  
that specific for this particular need, your suggestion of orderby  
turned out to be the perfect solution.  That said, the orderby in the  
collection-descriptor doesn't order anything if the collection is not  
sortable.  So if I had:

private Collection myFooChild = Collections.EMPTY_SET;
when OJB runs the query and then the sub query to go get myFooChild  
objects, and I have orderby="order" which is referenced in the  
collection-descriptor pointing to the Foo object's descriptor info, it  
sorts nothing, the myFooChild objects are sorted in what ever order  
they come back from the DB.

However, if I had:
private List myFooChild = Collections.EMPTY_LIST;
then orderby="order" works correctly and sorts the objects in the way I  
expect them to.

So either there's a bug in OJB, or OJB should be throwing an exception,  
or at the very least a warning, letting people know something like:   
"The [insert type of object name (Set, Collection)] you are trying to  
order your auto-retrieved objects using the orderby in your  
collection-descriptor is not sortable.  Please change your object type  
to a sortable type in order for this functionality to work properly".

Just a thought.
Right now with the default orderby and using List, I do one select and  
get everything back the way I need it for the view, so the  
functionality is beautiful when it works, but I bet I'm not the only  
one who might have hit that and wondered what's going on.  The orderby  
doesn't seem to affect the query itself, rather it affects the object  
after it's retrieved from the DB.

R
On Feb 7, 2005, at 11:36 AM, Jakob Braeuchi wrote:
hi robert,
the orderby should be used in the sql when retrieving this children.  
if you want to modify the orderby you could use a query-customizer.

hth
jakob
Robert S. Sfeir schrieb:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Yes, that gives it a default, but there is no way to change that  
based on query as far as I can tell, I wanted to make sure I didn't  
miss anything.

R
On Feb 6, 2005, at 3:58 AM, Jakob Braeuchi wrote:
hi robert,
have you tried the orderby in collection-descriptor ?
jakob
Robert S. Sfeir schrieb:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Either I'm rusty or this is a little trickier to do...
The issue is that I have a TicketType, which has a Collection of  
Attribute which itself has a Collection of AttributeType.
When I do a select for a Collection of Attribute(s) for a  
TicketType (select * from ticket_types tt, attributes a  where  
ticket_type=1 and tt.type_id = a.type_id order by  
a.attribute_order) I get a TicketType with its Attribute Collection  
and the Attribute Collection is correctly sorted by the order  
column.  But I need to take this a step further because an  
Attribute has a Collection of AttributeValue(s), and I want those  
AttributeValue objects to also be sorted by a specific column.
In other words I need the 3rd IN query that OJB triggers to get the  
AttributeValue to be sorted...
What's the most efficient way to do this?  I'd rather not do 2  
selects myself, I like having one select and have OJB deal with the  
prefetched relationships... and sorting...
I have another example which goes deeper from project to tickettype  
etc...
Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCBVhrJhqny0eCHK8RAvnjAJ0ZxKTArcUkJyxQlBZJ36JuEWOg5wCfXiCP
56Ietiiuhj5oIMVgHTFepT8=
=WJoc
-END PGP SIGNATURE-
 
-
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCBhojJhqny0eCHK8RAsD7AJ9FW2OovX5gPaljRPfBY2QhVab4oQCghHlA
wDpEg4gAbx99IF0qJVzUuec=
=8LLJ
-END PGP SIGNATURE-
-
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCB5xwJhqny0eCHK8RAlKjAJ9qNlv8zyZq+0ppZLJ9BFbAsk3LywCdF6zo
afLuz1fF5sns2KZt3yutPM8=
=H3wd
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-06 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jacob, I tried adding orderby to at least have a default sort for 
collections...  it does nothing, the order is wrong.  I added 
orderby="order" which is the field name in the referenced collection, 
the sort is not even close, either there's a bug (and I should dig into 
it) or I didn't understand how to use it.

R
On Feb 6, 2005, at 3:58 AM, Jakob Braeuchi wrote:
hi robert,
have you tried the orderby in collection-descriptor ?
jakob
Robert S. Sfeir schrieb:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Either I'm rusty or this is a little trickier to do...
The issue is that I have a TicketType, which has a Collection of 
Attribute which itself has a Collection of AttributeType.
When I do a select for a Collection of Attribute(s) for a TicketType 
(select * from ticket_types tt, attributes a  where ticket_type=1 and 
tt.type_id = a.type_id order by a.attribute_order) I get a TicketType 
with its Attribute Collection and the Attribute Collection is 
correctly sorted by the order column.  But I need to take this a step 
further because an Attribute has a Collection of AttributeValue(s), 
and I want those AttributeValue objects to also be sorted by a 
specific column.
In other words I need the 3rd IN query that OJB triggers to get the 
AttributeValue to be sorted...
What's the most efficient way to do this?  I'd rather not do 2 
selects myself, I like having one select and have OJB deal with the 
prefetched relationships... and sorting...
I have another example which goes deeper from project to tickettype 
etc...
Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCBVhrJhqny0eCHK8RAvnjAJ0ZxKTArcUkJyxQlBZJ36JuEWOg5wCfXiCP
56Ietiiuhj5oIMVgHTFepT8=
=WJoc
-END PGP SIGNATURE-
-
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCBmFfJhqny0eCHK8RAgegAJ98vIxFDOi7w1nNE0HrAYjnQ+KfYwCfZ4Te
CeJ29I/wlx8Q1DWNWcWVQg8=
=iode
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sorting Child Objects

2005-02-06 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Yes, that gives it a default, but there is no way to change that based 
on query as far as I can tell, I wanted to make sure I didn't miss 
anything.

R
On Feb 6, 2005, at 3:58 AM, Jakob Braeuchi wrote:
hi robert,
have you tried the orderby in collection-descriptor ?
jakob
Robert S. Sfeir schrieb:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Either I'm rusty or this is a little trickier to do...
The issue is that I have a TicketType, which has a Collection of 
Attribute which itself has a Collection of AttributeType.
When I do a select for a Collection of Attribute(s) for a TicketType 
(select * from ticket_types tt, attributes a  where ticket_type=1 and 
tt.type_id = a.type_id order by a.attribute_order) I get a TicketType 
with its Attribute Collection and the Attribute Collection is 
correctly sorted by the order column.  But I need to take this a step 
further because an Attribute has a Collection of AttributeValue(s), 
and I want those AttributeValue objects to also be sorted by a 
specific column.
In other words I need the 3rd IN query that OJB triggers to get the 
AttributeValue to be sorted...
What's the most efficient way to do this?  I'd rather not do 2 
selects myself, I like having one select and have OJB deal with the 
prefetched relationships... and sorting...
I have another example which goes deeper from project to tickettype 
etc...
Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCBVhrJhqny0eCHK8RAvnjAJ0ZxKTArcUkJyxQlBZJ36JuEWOg5wCfXiCP
56Ietiiuhj5oIMVgHTFepT8=
=WJoc
-END PGP SIGNATURE-
-
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCBhojJhqny0eCHK8RAsD7AJ9FW2OovX5gPaljRPfBY2QhVab4oQCghHlA
wDpEg4gAbx99IF0qJVzUuec=
=8LLJ
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Sorting Child Objects

2005-02-05 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Either I'm rusty or this is a little trickier to do...
The issue is that I have a TicketType, which has a Collection of 
Attribute which itself has a Collection of AttributeType.

When I do a select for a Collection of Attribute(s) for a TicketType 
(select * from ticket_types tt, attributes a  where ticket_type=1 and 
tt.type_id = a.type_id order by a.attribute_order) I get a TicketType 
with its Attribute Collection and the Attribute Collection is correctly 
sorted by the order column.  But I need to take this a step further 
because an Attribute has a Collection of AttributeValue(s), and I want 
those AttributeValue objects to also be sorted by a specific column.

In other words I need the 3rd IN query that OJB triggers to get the 
AttributeValue to be sorted...

What's the most efficient way to do this?  I'd rather not do 2 selects 
myself, I like having one select and have OJB deal with the prefetched 
relationships... and sorting...

I have another example which goes deeper from project to tickettype 
etc...

Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCBVhrJhqny0eCHK8RAvnjAJ0ZxKTArcUkJyxQlBZJ36JuEWOg5wCfXiCP
56Ietiiuhj5oIMVgHTFepT8=
=WJoc
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Optimistic Locking Problem.

2004-12-04 Thread Robert S. Sfeir
tionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> initializeForUOW.
>>>>>> [12/2/04 15:48:04:637 CST] 6de77661 SystemErr R CLIENTADDERDELAY:
>>>>>> After Update: 1
>>>>>> [12/2/04 15:48:04:637 CST] 797e3663 SystemErr R
>>>>>> *** END 
>>>>>> [12/2/04 15:48:47:729 CST] 797e3663 SystemErr R
>>>>>> *** START ********
>>>>>> [12/2/04 15:48:47:729 CST] 797e3663 SystemErr R SERVLET:  Starting
>>>>>> ClientAdderDelay
>>>>>> [12/2/04 15:48:47:729 CST] 797e3663 SystemErr R SERVLET:  Sleeping
>>>>>> 1000 millis
>>>>>> [12/2/04 15:48:47:779 CST] 1ec7f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> allocateMCWrapper.
>>>>>> [12/2/04 15:48:47:840 CST] 1ec7f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> initializeForUOW.
>>>>>> [12/2/04 15:48:47:850 CST] 1ec7f672 SystemErr R CLIENTADDERDELAY:
>>>>>> Before Update: 1
>>>>>> [12/2/04 15:48:47:850 CST] 1ec7f672 SystemErr R CLIENTADDERDELAY:
>>>>>> Sleeping for 5000 millis
>>>>>> [12/2/04 15:48:48:931 CST] 797e3663 SystemErr R SERVLET:  Starting
>>>>>> ClientAdder
>>>>>> [12/2/04 15:48:48:931 CST] 797e3663 SystemErr R SERVLET:  Joining
>>>>>> to ClientAdder
>>>>>> [12/2/04 15:48:48:931 CST] 1ec0f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> allocateMCWrapper.
>>>>>> [12/2/04 15:48:49:031 CST] 1ec0f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> initializeForUOW.
>>>>>> [12/2/04 15:48:49:041 CST] 1ec0f672 SystemErr R CLIENTADDER:
>>>>>> Before Update: 0
>>>>>> [12/2/04 15:48:49:041 CST] 1ec0f672 SystemErr R CLIENTADDER:
>>>>>> Changing name to 1
>>>>>> [12/2/04 15:48:49:051 CST] 1ec0f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> allocateMCWrapper.
>>>>>> [12/2/04 15:48:49:061 CST] 1ec0f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> initializeForUOW.
>>>>>> [12/2/04 15:48:49:081 CST] 1ec0f672 SystemErr R CLIENTADDER:
>>>>>> After Update: 1
>>>>>> [12/2/04 15:48:49:081 CST] 797e3663 SystemErr R SERVLET:  Joingin
>>>>>> to ClientAdderDelay
>>>>>> [12/2/04 15:48:52:857 CST] 1ec7f672 SystemErr R CLIENTADDERDELAY:
>>>>>> Changing name to 1
>>>>>> [12/2/04 15:48:52:857 CST] 1ec7f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> allocateMCWrapper.
>>>>>> [12/2/04 15:48:52:867 CST] 1ec7f672 ConnectionMan W J2CA0075W: An
>>>>>> active transaction should be present while processing method
>>>>>> initializeForUOW.
>>>>>> [12/2/04 15:48:52:877 CST] 1ec7f672 SystemErr R CLIENTADDERDELAY:
>>>>>> After Update: 1
>>>>>> [12/2/04 15:48:52:877 CST] 797e3663 SystemErr R
>>>>>> *** END 
>>>>>> 
>>>>>> Let me know if any more information would be helpful...
>>>>>> 
>>>>>> -
>>>>>> 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]
>>>> 
>>>> 
>>> 
>>> 
>>> -
>> 
>> 
>>> 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]


R

-- 
Robert S. Sfeir
Software Developer
Codepuccino
"Make everything as simple as possible, but not simpler." -- Einstein

http://www.codepuccino.com
blog: http://blogs.codepuccino.com/dude



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



Re: How to obtain autoincrement field value once an object is created?

2004-12-03 Thread Robert S. Sfeir
Not if you setup the primary key correctly and the foreign references.


On 12/2/04 11:00 PM, "Gene" <[EMAIL PROTECTED]> wrote:

> But before I can store() the object, I must filled the TheSameValueField
>  with values(same as Id field) as it is a not null field/column.
> Otherwise, database error will be raised.
> 
> Gene
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


R

-- 
Robert S. Sfeir
Software Developer
Codepuccino
"Make everything as simple as possible, but not simpler." -- Einstein

http://www.codepuccino.com
blog: http://blogs.codepuccino.com/dude



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



Re: How to obtain autoincrement field value once an object is created?

2004-12-02 Thread Robert S. Sfeir
Most of the time the broker.store() object will return the object you passed
in with the ID (primary key value) filled in.  So just do a Object.getID()
(of course substituting your object name and method name) after you've done
the store and you'll have the ID.

R


On 12/2/04 7:31 PM, "Gene" <[EMAIL PROTECTED]> wrote:

> Hi, anyone can tell me if I can obtain the autoincrement field value when I
> create an object? Because I would like to assign the same value to another
> field. For example:
> field "Id" is an autocrement field, and "TheSameValueField" is a normal field,
> I
> want to default/assign the value of "Id" field to field "TheSameValueField",
> how
> to realize that?
> 
> Any ideas are appreciated. Thanks.
> 
> Gene
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


R

-- 
Robert S. Sfeir
Software Developer
Codepuccino
"Make everything as simple as possible, but not simpler." -- Einstein

http://www.codepuccino.com
blog: http://blogs.codepuccino.com/dude



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



Re: OJB can't open database

2004-12-02 Thread Robert S. Sfeir
r instances. But it's possible to enable this
>>> at runtime using 'setDefaultKey' method.
>>> (metadata.ConnectionRepository   ?   ) Could not find
>>> org.apache.ojb.broker.metadata.JdbcConnectionDescriptor for PBKey
>>> org.apache.ojb.broker.PBKey: jcdAlias=default, user=null,
>>> password=null
>>> (odmg.DatabaseImpl   ?   ) Open database failed:
>>> Borrow broker from pool failed, using PBKey
>>> org.apache.ojb.broker.PBKey: jcdAlias=default, user=null,
>>> password=null
>>> org.apache.ojb.broker.PBFactoryException: Borrow broker from pool
>>> failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default,
>>> user=null, password=null
>>>at
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersist
> enceBroker(Unknown
>>> Source)
>>>at
> org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unkno
> wn
>>> Source)
>>>at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
>>>at CountryDA.main(CountryDA.java:33)
>>> Caused by: org.apache.ojb.broker.PBFactoryException: Given PBKey
>>> org.apache.ojb.broker.PBKey: jcdAlias=default, user=null,
>>> password=null does not match in metadata configuration
>>>at
> org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.createNewBrokerI
> nstance(Unknown
>>> Source)
>>>at
> org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolab
> leObjectFactory.makeObject(Unknown
>>> Source)
>>>at
> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeye
> dObjectPool.java:792)
>>>... 4 more
>>> org.odmg.DatabaseNotFoundException: OJB can't open database default
>>> Borrow broker from pool failed, using PBKey
>>> org.apache.ojb.broker.PBKey: jcdAlias=default, user=null,
>>> password=null
>>>at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source)
>>>at CountryDA.main(CountryDA.java:33)
>>> org.odmg.DatabaseClosedException: Database is NULL, must have a DB in
>>> order to create a transaction
>>>at org.apache.ojb.odmg.ImplementationImpl.newTransaction(Unknown
> Source)
>>>at CountryDA.main(CountryDA.java:42)
>>> Exception in thread "main"
>>> 
>>> 
>> 
>> The error states that OJB could not find the repository.xml file on the
>> classpath, so check its position: for a webapp put it into
>> WEB-INF/classes along with OJB.properties and also don't put OJB into
>> the server's shared lib folder but into the WEB-INF/lib folder of your
>> webapp.
>> 
>> Tom
>> 
>> -
>> 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]
> 
> 
> 
> ___
> HPD Software Ltd. - Helping Business Finance Business
> Email terms and conditions: www.hpdsoftware.com/disclaimer
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


R

-- 
Robert S. Sfeir
Software Developer
Codepuccino
"Make everything as simple as possible, but not simpler." -- Einstein

http://www.codepuccino.com
blog: http://blogs.codepuccino.com/dude



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



Re: Mysql deadlock / timeout

2004-11-30 Thread Robert S. Sfeir
Huh is OJB competing with some other processes trying to update the same
table/db?  It looks like it's complaining that it can't get a lock on row,
and what ever process is not giving it up.

Make also sure that all your transactions end by closing the PB instance.

I would add some debugging info to see which record is being updated at the
time, with a timestamp to tell you when it was happening, and I would try to
catch this specific exception and resubmit the update again once or twice
before failing, if there indeed is another process updating the DB.

Last thought... Is it around a time when you have a DB backup going on?
Some backups make the db/table read only, and that could be a problem.

HTH
R


On 11/30/04 12:43 PM, "Jin Bal" <[EMAIL PROTECTED]> wrote:

> Hello 
> 
> I have an app in production that occasionally suffers from what seems to be a
> deadlock or timout when doing a simple update inside a transaction
> 
> here is the stacktrace - can anyone shed any light on things??
> 
> TIA
> 
> Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException:
> java.sql.SQLException: Deadlock found when trying to get lock; Try restarting
> transaction, message from server: "Lock wait timeout exceeded; Try restarting
> transaction"
> 
> at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdateSQL(Unknown
> Source)
> 
> at org.apache.ojb.broker.core.MtoNBroker.deleteMtoNImplementor(Unknown Source)
> 
> at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeAndLinkMtoN(Unknown
> Source)
> 
> at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollections(Unknown
> Source)
> 
> at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown Source)
> 
> at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
> 
> at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
> 
> at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
> 
> at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
> 
> at com.buyacar.dtofactory.OJBTransactionImpl.save(OJBTransactionImpl.java:54)
> 
> at com.buyacar.dtofactory.UserFactory.saveUser(UserFactory.java:28)
> 
> 



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



Re: Unique query without using primary key?

2004-11-23 Thread Robert S. Sfeir
The only thing to worry about with Anonymous keys and using them on primary
keys is an issue with clustering, there is a warning about it on the
Anonymous keys page docs.  If you're not clustering there is no reason why
you can't do what you're describing below.

R


On 11/23/04 4:00 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:

> Thank you so much.  I have done lots of crazy queries, but have not done one
> where I was not wanting a primary key in the result.   I have some learning to
> do as to which is better way to handle this.  I have to look up both
> rowreaders and anonymous keys.
> 
> I would prefer if the searchword table didn't even have a primary key, but
> just an indexed sidsince search words will be added and deleted all the
> time.
> 
> Thanks for the great nudge,
> 
> JohnE
> 
> 
> 
> - Original Message -
> From: Danilo Tommasina <[EMAIL PROTECTED]>
> Date: Tuesday, November 23, 2004 4:44 am
> Subject: Re: Unique query without using primary key?
> 
>> A ReportQueryByCriteria should do the job:
>> 
>> something like this:
>> 
>> Criteria crit = new Criteria();
>> crit.addLike( "state", "somestate" );
>> crit.addLike( ".searchword", "somesearchword" );
>> 
>> ReportQueryByCriteria query = new ReportQueryByCriteria(
>> SearchKeys.class, new String [] { "sid" }, crit, true );
>> 
>> PersistenceBroker pb = null;
>> try {
>>   pb = PersistenceBrokerFactory.defaultPersistenceBroker();
>> 
>>   ArrayList results = new ArrayList();
>>   for ( Iterator resultsIt = pb.getReportQueryIteratorByQuery(
>> query ); resultsIt.hasNext(); ) {
>>   results.add( ((Object []) resultsIt.next())[ 0 ] );
>>   }
>> 
>>   // The results ArrayList now contains all the ids you need
>>   // Note: always extact the values from the Iterator before
>> closing the broker.
>> 
>> } catch ( Exception e ) {
>>   // Do exception handling
>> } finally {
>>   if ( pb != null ) {
>>  pb.close();
>>   }
>> }
>> 
>> Replace  with the reference path defined in
>> your repository.xml
>> I didn't tested the code, so there are probably syntax errors...
>> 
>> 
>>> I am not getting this.  I need a nudge in the right direction.
>>> 
>>> I want to do this query:
>>>  select distinct sk.sid from searchkeys sk, searchwords sw
>>>where sw.searchword="somesearchword"
>>> sw.sid = sk.sid
>>> sk.state="somestate";
>>> 
>>> table searchkeys:
>>>   sid <-- unique PK
>>>   state
>>> 
>>> table searchwords:
>>>   swid <-- unique PK I wish OJB
>> didn't require
>>>   sid   <-- sid in searchkey table
>>>   searchword
>>> 
>>> searchkeys and searchwords having a 1:n relationship.
>>> 
>>> 
>>> Right now I both tables mapped according to their
>> characteristics which I have done many times before.  In the past
>> I have always wanted the primary keys and full records.
>>> 
>>> Here I don't want the full records or mapping, but just a
>> collection of the unique sid.  I would prefer not to get the full
>> records and I only require this for read and not write.   Imagine
>> I am doing a keyword search and I just want to know which services
>> match the search criteria.
>>> 
>>> Can anybody nudge me in the right direction?   Would be great to
>> get past this problem.  I am trying to inprove the searching on my
>> live OJB used site by including parts of the Lucene project, but
>> need to be able to do this for it to work.
>>> 
>>> Thanks lots.
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -
>> 
>>> 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]



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



Re: Unique query without using primary key?

2004-11-22 Thread Robert S. Sfeir
Anonymous keys

R


On 11/22/04 8:46 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:

> I am not getting this.  I need a nudge in the right direction.
> 
> I want to do this query:
>  select distinct sk.sid from searchkeys sk, searchwords sw
>where sw.searchword="somesearchword"
> sw.sid = sk.sid
> sk.state="somestate";
> 
> table searchkeys:
>   sid <-- unique PK
>   state
> 
> table searchwords:
>   swid <-- unique PK I wish OJB didn't require
>   sid   <-- sid in searchkey table
>   searchword
> 
> searchkeys and searchwords having a 1:n relationship.
> 
> 
> Right now I both tables mapped according to their characteristics which I have
> done many times before.  In the past I have always wanted the primary keys and
> full records.
> 
> Here I don't want the full records or mapping, but just a collection of the
> unique sid.  I would prefer not to get the full records and I only require
> this for read and not write.   Imagine I am doing a keyword search and I just
> want to know which services match the search criteria.
> 
> Can anybody nudge me in the right direction?   Would be great to get past this
> problem.  I am trying to inprove the searching on my live OJB used site by
> including parts of the Lucene project, but need to be able to do this for it
> to work.
> 
> Thanks lots.
> 
> 
> 
> 
> 
> -
> 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]



Re: How to markup for xdoclet inheritance structure?

2004-11-16 Thread Robert S. Sfeir
Wow nice catch!  I didn't even notice, I guess I was looking quick.  I
wonder if it was Wallace's copy paste problem.

R


On 11/16/04 2:19 PM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> I haven't successfully used xdoclet, but if it is like javadoc, you need to
> start the comments with double asterisk: /** not just /*.
> 
> my 2 cents
> CQ
> 
> Original Message:
> -
> From: Gelhar, Wallace Joseph [EMAIL PROTECTED]
> Date: Tue, 16 Nov 2004 10:56:09 -0600
> To: [EMAIL PROTECTED]
> Subject: RE: How to markup for xdoclet inheritance structure?
> 
> 
> Actually this is the logger output as well.  Where do I start to debug
> this?  
> 
> repository-files:
> java.util.logging.ErrorManager: 2
> java.lang.NullPointerException
> at org.apache.tools.ant.Project.getThreadTask(Project.java:1985)
> at org.apache.tools.ant.Project.demuxOutput(Project.java:1086)
> at
> org.apache.tools.ant.DemuxOutputStream.processBuffer(DemuxOutputStream.j
> ava:172)
> at
> org.apache.tools.ant.DemuxOutputStream.write(DemuxOutputStream.java:147)
> at
> org.apache.tools.ant.DemuxOutputStream.write(DemuxOutputStream.java:241)
> at java.io.PrintStream.write(PrintStream.java:258)
> at
> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)
> at
> sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:40
> 4)
> at
> sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:408)
> at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)
> at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
> at java.util.logging.StreamHandler.flush(StreamHandler.java:224)
> at
> java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:88)
> at java.util.logging.Logger.log(Logger.java:424)
> at java.util.logging.Logger.doLog(Logger.java:446)
> at java.util.logging.Logger.logp(Logger.java:562)
> at
> org.apache.commons.logging.impl.Jdk14Logger.log(Jdk14Logger.java:91)
> at
> org.apache.commons.logging.impl.Jdk14Logger.info(Jdk14Logger.java:162)
> at xdoclet.XDocletMain.start(XDocletMain.java:47)
> at xdoclet.DocletTask.start(DocletTask.java:462)
> at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:110)
> at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
> at org.apache.tools.ant.Task.perform(Task.java:364)
> at org.apache.tools.ant.Target.execute(Target.java:301)
> at org.apache.tools.ant.Target.performTasks(Target.java:328)
> at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
> at
> org.apache.tools.ant.Project.executeTargets(Project.java:1063)
> at
> org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:1
> 78)
> at
> org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:2
> 52)
> at
> org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
> Generating ojb repository descriptor (repository_user.xml)
> Type uwec.fpm.persistence.report.Report
> Type uwec.fpm.persistence.report.ReportParameterValueImpl
> Type uwec.fpm.persistence.report.ReportParameterValue
> Type uwec.fpm.persistence.report.ReportField
> Type uwec.fpm.persistence.report.ReportParameterImpl
> Type uwec.fpm.persistence.PersistentObjectImpl
> Type uwec.fpm.persistence.report.ReportFieldType
> Type uwec.fpm.persistence.report.ReportParameter
> Type uwec.fpm.persistence.PersistentObject
> Processed 9 types
> Warning: The class uwec.fpm.persistence.PersistentObject has no primary
> key
> Warning: The class uwec.fpm.persistence.PersistentObjectImpl has no
> primary key
> Warning: The class uwec.fpm.persistence.report.ReportParameterImpl has
> no primary key
> Warning: The class uwec.fpm.persistence.report.ReportParameterValue has
> no primary key
> Warning: The class uwec.fpm.persistence.report.ReportParameterValueImpl
> has no primary key
> Processed 9 types
>  
> 
> -Original Message-
> From: Gelhar, Wallace Joseph
> Sent: Tuesday, November 16, 2004 10:24 AM
> To: OJB Users List
> 
> Subject: RE: How to markup for xdoclet inheritance structure?
> 
> What is wrong with this markup.  I've followed your advice and allowed
> xdoclet to generate a table for the persistent base class (even though
> the fields are in each concrete classes table), but this fails to
> produce *any* fields in the repository.  Do I really have to duplicate
> each @ojb.field tag FIVE times for each property?
>  
> BTW, I am using xdoclet-1.2.1, xdoclet-ojb-module-1.2.1, and
> xjavadoc-1.0.3 from CVS.
> 
> Any other suggestions?
> 
> /**
>  * @ojb.class
>  */
> public interface PersistentObject {
> 
> /*
>  * @ojb.field column="ID"
>  *jdbc-type="INTEGER"
>  *primarykey="true"
>  */  
> public Integer getId();
> /*
>  * @ojb.field column="ID"
>  *   

Re: How to markup for xdoclet inheritance structure?

2004-11-16 Thread Robert S. Sfeir
Well the docs say you only need to set it on either the get or set.  Not
both.  I put it on the get.

Also, I believe (haven't tried yet), since java docs are inherited by the
impl, you only need to set it there.

Third you need to put a little more than that in your class definition
otherwise xdoclet has no idea what your table is called, especially if you
intend to use Interfaces.  The following below should figure it all out for
you:

@ojb.class table="cdpcno_projects" determine-extents="true"
include-inherited="true" generate-table-info="true" refresh="true"

For your ID fields you might want to consider something like this:
@ojb.field indexed="true" column="project_id" jdbc-type="INTEGER"
primarykey="true" autoincrement="ojb"

Hth more.

R


On 11/16/04 11:23 AM, "Gelhar, Wallace Joseph" <[EMAIL PROTECTED]> wrote:

> What is wrong with this markup.  I've followed your advice and allowed
> xdoclet to generate a table for the persistent base class (even though
> the fields are in each concrete classes table), but this fails to
> produce *any* fields in the repository.  Do I really have to duplicate
> each @ojb.field tag FIVE times for each property?
>  
> BTW, I am using xdoclet-1.2.1, xdoclet-ojb-module-1.2.1, and
> xjavadoc-1.0.3 from CVS.
> 
> Any other suggestions?
> 
> /**
>  * @ojb.class 
>  */
> public interface PersistentObject {
> 
> /*
>  * @ojb.field column="ID"
>  *jdbc-type="INTEGER"
>  *primarykey="true"
>  */  
> public Integer getId();
> /*
>  * @ojb.field column="ID"
>  *jdbc-type="INTEGER"
>  *primarykey="true"
>  */  
> public void setId(Integer id);
> ...
> }
> 
> /**
>  * @ojb.class
>  */
> public abstract class PersistentObjectImpl implements PersistentObject {
> 
> /*
>  * @ojb.field column="ID"
>  *jdbc-type="INTEGER"
>  *primarykey="true"
>  */
> protected Integer id;
> /*
>  * @ojb.field column="ID"
>  *jdbc-type="INTEGER"
>  *primarykey="true"
>  */  
> public Integer getId() { return id; }
> /*
>  * @ojb.field column="ID"
>  *jdbc-type="INTEGER"
>  *primarykey="true"
>  */  
> public void setId(Integer id) { this.id = id; }
> ...
> }
> 
> /**
>  * @ojb.class 
>  */
> public interface ReportParameterValue extends PersistentObject {
> /*
>  * @ojb.field column="ParameterValue"
>  */
> public String getValue();
> /*
>  * @ojb.field column="ParameterValue"
>  */
> public void setValue(String value);
> }
> 
> /**
>  * @ojb.class table="tblRptReportParameterValue"
>  * @ojb.field name="reportParameterID"
>  *column="ReportParameterID"
>  *jdbc-type="INTEGER"
>  */
> public class ReportParameterValueImpl extends PersistentObjectImpl
> implements ReportParameterValue {
> /*
>  * @ojb.field column="ParameterValue"
>  */
> protected String value;
> ...
> /*
>  * @ojb.field column="ParameterValue"
>  */
> public String getValue() { return value; }
> /*
>  * @ojb.field column="ParameterValue"
>  */
> public void setValue(String value) { this.value = value; }
> }
> 
> This is the repository it produces:
> 
> 
> 
> 
>  class="uwec.fpm.persistence.PersistentObject"
> table="PersistentObject"
>> 
>  class-ref="uwec.fpm.persistence.PersistentObjectImpl"/>
>  class-ref="uwec.fpm.persistence.report.ReportParameterValue"/>
> 
>  class="uwec.fpm.persistence.PersistentObjectImpl"
> table="PersistentObjectImpl"
>> 
>  class-ref="uwec.fpm.persistence.report.ReportParameterValueImpl"/>
> 
>  class="uwec.fpm.persistence.report.ReportParameterValue"
> table="ReportParameterValue"
>> 
>  class-ref="uwec.fpm.persistence.report.ReportParameterValueImpl"/>
> 
>  class="uwec.fpm.persistence.report.ReportParameterValueImpl"
> table="tblRptReportParameterValue"
>> 
>  name="reportParameterID"
> column="ReportParameterID"
> jdbc-type="INTEGER"
> access="anonymous"
>> 
> 
> 
> 
> 
> -Original Message-
> From: Thomas Dudziak [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 15, 2004 6:09 PM
> To: OJB Users List
> Subject: Re: How to markup for xdoclet inheritance structure?
> 
> Gelhar, Wallace Joseph wrote:
> 
>> I am trying to use xdoclet to map an inheritance hierarchy as follows,
> 
>> but it fails to include any inherited fields.  Any ideas?
> 
> The generate-table-info="false" setting disables generation of
> field/reference/collection entries. See here for details:
> 
> http://db.apache.org/ojb/docu/guides/xdoclet-module.html#ojb.class
> 
> You should also put the ojb.field tags at the getter or setter methods
> in the interfaces because this will cause their definition to be
> inherited in all implementing classes.
>

Re: references foreign key

2004-11-03 Thread Robert S. Sfeir
Wild guess...

Is your idServicio an integer or a string?  It seems like you might have it
defined as a string when it should be an int.

R


On 11/3/04 2:42 PM, "David Morales de Frias" <[EMAIL PROTECTED]> wrote:

> Hi ¡
>  
> Please, can you help me?
>  
> When i throw a queryByCriteria, querying an object that have foreign keys,
> this sql spends a lot of time executing and suddenly it throws this error
>  
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:SELECT 
> A0.ID_PACKAGES,A0.NUM_TFNO_DESTINO,A0.COD_TLLAMADA,A0.NUM_RESUMEN,A0.SERVICIO_
> LLAMADA,A0.COD_MERCADO,A0.COD_TTARIFA,A0.FECHA,A0.COD_TSERVICIO,A0.CODIGO_AREA
> ,A0.COD_TDESTINO,A0.CATEGORIA_LLAMADA,A0.COD_TPERIODO,A0.DURACION,A0.COSTE,A0.
> TCATEGORIA,A0.MSISDN,A0.NUM_TFNO_ORIGEN,A0.CODIGO_PAIS,A0.MODELO_TARIFAS,A0.CO
> D_FACTURA,A0.HORA_INICIO,A0.FECHA_FACTURA,A0.COSTE_IC FROM
> AUNABILL_DES.TAFM_DETALLE_LLAMADAS A0 WHERE A0.COD_FACTURA = ?
> 
> [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG:
> SQL:SELECT A0.DESCRIPCION2,A0.COD_TSERVICIO,A0.DESCRIPCION1,A0.DESCRIPCION3
> FROM AUNABILL_DES.TSERVICIOS A0 WHERE A0.COD_TSERVICIO = ?
> 
> [PersistentField] ERROR: while set field:
> 
> [try to set 'object value' in 'target object'
> 
> target obj class: es.indra.aunabill.vo.Tafm_detalle_llamadasJOIN
> 
> target field name: idServicio
> 
> target field type: class java.lang.String
> 
> object value class: es.indra.aunabill.vo.Tservicios
> 
> object value: [COD_TSERVICIO] TEL [DESCRIPCION1] Telefonía [DESCRIPCION2]
> Telefonía [DESCRIPCION3] Telefonía
> 
> ]
> 
> org.apache.ojb.broker.metadata.MetadataException: IllegalAccess error setting
> field:idServicio in object:es.indra.aunabill.vo.Tafm_detalle_llamadasJOIN
> 
>  
>  
> 
> -
> 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]



Re: Simple DISTINCT query

2004-09-30 Thread Robert S. Sfeir
"JDBC]Invalid column name: AMOUNT"

Seems in your xml you're referring to a column called AMOUNT, but your
table either doesn't have it, or it's not the right name.

R

You Said Something Like: Ian HunterYou Were Done Here.
> Like this?  (This is what failed)
>
> public static Collection getAllBillDates (AuthorizedUser user) throws
> PersistenceException, PermissionDeniedException {
> Criteria c = new Criteria();
> ReportQueryByCriteria q = QueryFactory.newReportQuery
> (BillItem.class, c, true);
> q.setAttributes(new String[] { "billingRun" });
> q.addOrderByDescending("billingRun");
> DataStore ds = new DataStore (user);
> Collection result = ds.getCollectionByQuery(q);  // <--- exception
> is thrown here
> ArrayList dates = new ArrayList();
> Iterator i = result.iterator();
> while (i.hasNext()) {
> BillItem bi = (BillItem) i.next();
> dates.add (bi.getBillingRun());
> }
> return dates;
> }
>
> The "datastore" object wraps calls to the PB API.  You can see a call to
> "getCollectionByQuery" which basically calls "getCollectionByQuery" and
> catches PersistenceBrokerExceptions and redefines them as
> generic-to-application "PersistenceException" objects.
>
> The actual object definition is this:
>
>
>primarykey="true" autoincrement="true" />
>jdbc-type="INTEGER" nullable="false"/>
>auto-retrieve="true" auto-update="none" auto-delete="none">
>  
>   
>jdbc-type="TIMESTAMP"
> conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
> ampFieldConversion" />
>nullable="false" />
>nullable="false" />
>jdbc-type="VARCHAR" nullable="false" />
>conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo
> nversion" nullable="false" />
>
>
> The error I got was:
>
> Caused by: org.apache.ojb.broker.PersistenceBrokerException: Error reading
> class type: BillItem from result set, current read field was amount
>  at
> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readValuesFrom(RowRea
> derDefaultImpl.java:205)
>  at
> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readObjectArrayFrom(R
> owReaderDefaultImpl.java:176)
>  at
> org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterat
> or.java:427)
>  at org.apache.ojb.broker.accesslayer.RsIterator.next(RsIterator.java:265)
>  at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryRe
> ferenceBroker.java:121)
>  at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryRe
> ferenceBroker.java:232)
>  ... 89 more
> Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
> JDBC]Invalid column name: AMOUNT
>  at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
>  at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
>  at com.microsoft.jdbc.base.BaseResultSet.getColumnOrdinal(Unknown Source)
>  at com.microsoft.jdbc.base.BaseResultSet.getDouble(Unknown Source)
>  at
> org.apache.ojb.broker.util.JdbcTypesHelper$T_Float.readValueFromResultSet(Jd
> bcTypesHelper.java:773)
>  at
> org.apache.ojb.broker.util.JdbcTypesHelper$BaseType.getObjectFromColumn(Jdbc
> TypesHelper.java:302)
>  at
> org.apache.ojb.broker.util.JdbcTypesHelper$BaseType.getObjectFromColumn(Jdbc
> TypesHelper.java:281)
>  at
> org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl.readValuesFrom(RowRea
> derDefaultImpl.java:199)
>  ... 94 more
>
> So why is it referring to "amount" at all?
>
> - Original Message -
> From: "Stijn de Witt" <[EMAIL PROTECTED]>
> To: "OJB Users List" <[EMAIL PROTECTED]>
> Sent: Thursday, September 30, 2004 12:33 PM
> Subject: Re: Simple DISTINCT query
>
>
>> Look at ReportQueries, they are part of the PersistenceBroker interface
>> and let you perform selects where the result is not a complete object.
>>
>> -Stijn
>>
>> Ian Hunter wrote:
>>
>> >I've been pulling my ahir out trying to accomplish something simple.
>> Say
> I
>> >have a table called FOO, with fields FOOID (int), FOODATE (datetime),
>> and
>> >FOOAMOUNT (double).  Some process writes data to this table, where
>> FOOID
> is
>> >a autoincrement field, FOODATE is a datestamp, for which there can be
>> >duplicates, and FOOFOO which represents some number.
>> >
>> >I want to generate this query:  SELECT DISTINCT FOODATE FROM FOO; -- I
> can't
>> >figure out how to do this, because it seems like OBJ is wanting to load
> all
>> >the fields from the resulting query, including ones I don't need, such
>> as
>> >FOOAMOUNT.
>> >
>> >How do I do this?
>> >
>> >---
>> >beati pacifici quoniam filii Dei vocabuntur
>> >
>> >
>> >-
>> >To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> ---

Re: OJB vs Hibernate

2004-08-09 Thread Robert S. Sfeir
I wasn't kidding, HB list might help him figure out why it's so slow, it
would be interesting to know what we're doing better that causes this.

R


On 8/9/04 9:24 AM, "Brian McCallister" <[EMAIL PROTECTED]>
wrote:

> On Aug 9, 2004, at 9:13 AM, Robert S. Sfeir wrote:
> 
>> 
>> P.S. Did you post this on Hibernate list???  :-)
>> 
> 
> gack, I realize this is a joke, but... please don't! The last thing we
> need are more O/R pissing matches :-)
> 
> -Brian
> 
> 
> 
> -
> 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]



Re: OJB vs Hibernate

2004-08-09 Thread Robert S. Sfeir
Brian,
Thanks for the post.  The times between rc2 and 1.0, I believe, are actually
to new PersistentFieldIntrospectorImplNew.  If you're not using that, you
should and you'll see an even bigger diff.  That setting can be changed in
OJB.properties

HTH
R

P.S. Did you post this on Hibernate list???  :-)


On 8/9/04 8:57 AM, "Mcgough, Brian Joseph" <[EMAIL PROTECTED]> wrote:

> All,
>  
> I just wanted to share some data points that were recently collected
> that compare OJB and Hibernate and the ability to scale with both.
>  
> We had a data file with only 10,000 records in it that we needed to load
> into our database.  Typically we use our batch environment, but given
> that we are a java shop now, we wanted to see if we could use java and
> our ORM tool to get the job done.
>  
> We started out using Hibernate for this, and we found that we had some
> real problems.  It just would not scale whether or not we were using
> transactions.  We found that it would take greater than 17 hours to load
> only 7500 of the records.  Obviously this is unacceptable performance,
> and so we thought to try the same thing using OJB.
>  
> I am happy to report that using OJB we were able to load the whole file
> of 10,000 in under 12 minutes.
>  
> In addition to this, we just recently upgraded a project from OJB 1.0
> rc2 to OJB 1.0 and I am happy to report that for that particular project
> db performance was improve by a factor greater than 10.  This is mostly
> due to the new implementation for FieldAccess.
>  
> I just wanted to thank the developers for their attention to detail in
> regards to ensuring that the overhead above jdbc was minimal, and for
> all of the tests that they have written to ensure that is the case.  We
> are very happy that we are still able to use ORM for this instead of
> straight jdbc, because the rest of the application is written using the
> ORM.
>  
> Anyway I just wanted to share these points with the group, for those of
> you that are out there and are on the sidelines as far as which
> framework will scale better.
>  
> Brian McGough
> IU - UITS - UIS - SIT
> (812) 856-4871
>  



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



Re: Assistance with Timestamp

2004-08-02 Thread Robert S. Sfeir
Dunno what DB you're on, but the DB will store the timestamp based on the
JDBC driver/format your DB wants.

On the retrieving of the Timestamp be sure that you're calling it the right
way, OJB does nothing to remove information, if it doesn't come back from
you DB, it's not going to show up.

R


On 8/2/04 8:15 PM, "Kalichar" <[EMAIL PROTECTED]> wrote:

> I have a simple POJO that is defined in Oracle as DATE_TEST {ID, CREATED} of
> type {NUMBER (9), DATE}. The equivalent POJO is:
> 
> class DateTest {
>public Integer ID;
>public Timestamp created;
>
>// Evuivalent getter/setters
>
> }
> 
> repository mapping file is defined as follows:
> name="created"
>column="CREATED"
>jdbc-type="TIMESTAMP"
> />
> 
> 
> I am hoping to store the Date in the format .MM.dd HH:mm:ss. How can I
> accomplish this. When I attempt to store my POJO, it stores it in a different
> format and while retrieving it, I seem to lose the "HH:mm:ss".
> 
> Any assitance in the matter would be great. Thanks in advance.
> Kalichar
> 
> 
> -
> 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]



Re: HSQLDB Issue

2004-04-13 Thread Robert S. Sfeir
Janssen, Roger wrote:

hi,

be also aware that HSQLDB in 'stand-alone' mode only allows one connection!
If you use the database in this mode, you may only have one and only one
persistencebroker instantiated at any time!
I don't know if this has got anything to do with your problem though
 

Hum, don't think it does since I'm the only one testing the app from 
within my IDE, however thanks for the warning because it's something I 
would have ran into eventually.

I think perhaps the solution right now is to have HSQLDB create a DB at 
startup in some directory, I think perhaps the app server's root 
directory might be a good place for now and can be set by simply 
ommitting the first / in the path.  So if I set myapp-data/myapp it will 
create a myapp.script and properties file at the root of the Tomcat 
folder.  Might not be a bad thing for a demo setup.

I still need to write something which will install the tables if they 
don't exist.

That said, I need to figure out what the heck is up with hsqldb telling 
me that the sequence is missing... sigh...

R

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


Re: HSQLDB Issue

2004-04-13 Thread Robert S. Sfeir
Hum won't quite work, but I am still concerned that I can't get an 
insert to work with hsqldb, so something is haywire with my DB somewhere 
because my code works with other DBs (Postgresql, MySQL and oracle).

Anyone have ANY clues as to what my be happening?

R

Charles Anthony wrote:

-Original Message-
From: Thomas Mahler [mailto:[EMAIL PROTECTED]
Sent: 12 April 2004 07:06
To: OJB Users List
Subject: Re: HSQLDB Issue
   

[...]

 

The other issue is that I can't seem to find a way to get 
 

OJB to find 
   

the hsqldb script and data files directly within the exploded war 
directory.  What's the trick there?  I want to be able to 
 

deliver a war 
   

file to users, have it explode, then the app is just up and 
 

running with 
   

no configuration necessary...  what's the trick?
 

This is not an OJB issue, it's caused by HSQLDB.
I've been looking for this feature for ages! This would make usage of 
hsqldb extremely simple in web apps!
The bad news is that I don't think that it is possible with current 
versions of HSQLDB.
You have to use the complete filesystem path in the OJB connection 
descriptor.
   

I am sure I'm missing something, but couldn't you just use the classloader
to find the location of the database ? 

Assuming the database was called "mydb", I believe the following should work
out the jdbc URL of the HSQL DB :
   ClassLoader cl = Thread.currentThread().getContextClassLoader();
   URL url = cl.getResource("mydb.properties");
   /* URL probably is file://pathtothefile  */
   if(url!=null){
 /* Get rid of the leading '/' - probably not required on non-windows
os's */
 String path = url.getPath().substring(1);
 /* Remove the .properties from the end */
 path = path.substring(0, path.lastIndexOf('.'));
 String databaseUrl = "jdbc:hsqldb:" + path;
 
   }

You could then dynamically modify the Connection descriptor in the metadata.

I, myself, think it's a bit dodgy to assume that the WAR file is definitely
exploded. I would suggest that you use the classloader (and a bit more
jiggery-pokery) to copy the database from the WAR to a temporary directory -
a bit more complex, but probably safer (but then, what happens when the
OS/restarts ? the db disappears.)
Cheers,

Charles.

 

:-( Maybe we should approach the hsqldb guys to add this feature?

cheers,
Thomas
   

[ERROR] SequenceManagerHighLowImpl - -Can't lookup new 
 

HighLowSequence 
   

for field browserID using sequence name SEQ_CDPCNO_BROWSERS 
java.sql.SQLException: 
java.util.NoSuchElementException
  at 

 

org.apache.commons.dbcp.PoolingDataSource.getConnection(Poolin
gDataSource.java:112) 
   

  at 

 

org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl.ge
tConnectionFromPool(ConnectionFactoryDBCPImpl.java:56) 
   

  at 

 

org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImp
l.lookupConnection(ConnectionFactoryAbstractImpl.java:101) 
   

  at 

 

org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getCon
nection(ConnectionManagerImpl.java:144) 
   

  at 

 

org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localB
egin(ConnectionManagerImpl.java:186) 
   

The sql for the tables is, maybe I got the wrong ones? (Got 
 

them from 
   

the OJB samples)

CREATE TABLE OJB_HL_SEQ(TABLENAME VARCHAR(175) NOT NULL,FIELDNAME 
VARCHAR(70) NOT NULL,MAX_KEY INTEGER,GRAB_SIZE INTEGER,VERSION 
INTEGER,CONSTRAINT SYS_PK_OJB_HL_SEQ PRIMARY 
 

KEY(TABLENAME,FIELDNAME))
   

CREATE TABLE OJB_LOCKENTRY(OID_ VARCHAR(250) NOT NULL,TX_ID 
 

VARCHAR(50) 
   

NOT NULL,TIMESTAMP_ TIMESTAMP,ISOLATIONLEVEL INTEGER,LOCKTYPE 
INTEGER,CONSTRAINT SYS_PK_OJB_LOCKENTRY PRIMARY KEY(OID_,TX_ID))
CREATE TABLE OJB_NRM(NAME VARCHAR(250) NOT NULL PRIMARY KEY,OID_ 
LONGVARBINARY)
CREATE TABLE OJB_DLIST(ID INTEGER NOT NULL PRIMARY 
 

KEY,SIZE_ INTEGER)
   

CREATE TABLE OJB_DLIST_ENTRIES(ID INTEGER NOT NULL PRIMARY 
 

KEY,DLIST_ID 
   

INTEGER,POSITION_ INTEGER,OID_ LONGVARBINARY)
CREATE TABLE OJB_DSET(ID INTEGER NOT NULL PRIMARY KEY,SIZE_ INTEGER)
CREATE TABLE OJB_DSET_ENTRIES(ID INTEGER NOT NULL PRIMARY 
 

KEY,DLIST_ID 
   

INTEGER,POSITION_ INTEGER,OID_ LONGVARBINARY)
CREATE TABLE OJB_DMAP(ID INTEGER NOT NULL PRIMARY KEY,SIZE_ INTEGER)
CREATE TABLE OJB_DMAP_ENTRIES(ID INTEGER NOT NULL PRIMARY 
 

KEY,DMAP_ID 
   

INTEGER,KEY_OID LONGVARBINARY,VALUE_OID LONGVARBINARY)

TIA
R
 

-
   

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]
   



___
HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer 



-

Re: HSQLDB Issue

2004-04-12 Thread Robert S. Sfeir
Thomas Mahler wrote:

Hi Robert

Robert S. Sfeir wrote:

All,

I am trying to setup my app so I can use hsqldb.  First time using 
that db with OJB.  I've pointed the repository's connection info so 
it will find the DB files at /application-data dir, and it finds them 
fine since my select works, however if I try to do an insert, I'm 
getting this error (part of it), which I've never gotten before with 
any other DBs.  I've got the proper OJB specific tables in the DB of 
course.  Is there a special trick with hsqldb?


I'm not aware of any tricks. At least in our junit tests inserting 
into hsqldb works great.
Yeah and my unit tests pass also :-\  So what could be the problem???

R

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


HSQLDB Issue

2004-04-11 Thread Robert S. Sfeir
All,

I am trying to setup my app so I can use hsqldb.  First time using that 
db with OJB.  I've pointed the repository's connection info so it will 
find the DB files at /application-data dir, and it finds them fine since 
my select works, however if I try to do an insert, I'm getting this 
error (part of it), which I've never gotten before with any other DBs.  
I've got the proper OJB specific tables in the DB of course.  Is there a 
special trick with hsqldb?

The other issue is that I can't seem to find a way to get OJB to find 
the hsqldb script and data files directly within the exploded war 
directory.  What's the trick there?  I want to be able to deliver a war 
file to users, have it explode, then the app is just up and running with 
no configuration necessary...  what's the trick?

[ERROR] SequenceManagerHighLowImpl - -Can't lookup new HighLowSequence 
for field browserID using sequence name SEQ_CDPCNO_BROWSERS 
java.sql.SQLException: 
java.util.NoSuchElementException
   at 
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:112)
   at 
org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl.getConnectionFromPool(ConnectionFactoryDBCPImpl.java:56)
   at 
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConnection(ConnectionFactoryAbstractImpl.java:101)
   at 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(ConnectionManagerImpl.java:144)
   at 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(ConnectionManagerImpl.java:186)
  

The sql for the tables is, maybe I got the wrong ones? (Got them from 
the OJB samples)

CREATE TABLE OJB_HL_SEQ(TABLENAME VARCHAR(175) NOT NULL,FIELDNAME 
VARCHAR(70) NOT NULL,MAX_KEY INTEGER,GRAB_SIZE INTEGER,VERSION 
INTEGER,CONSTRAINT SYS_PK_OJB_HL_SEQ PRIMARY KEY(TABLENAME,FIELDNAME))
CREATE TABLE OJB_LOCKENTRY(OID_ VARCHAR(250) NOT NULL,TX_ID VARCHAR(50) 
NOT NULL,TIMESTAMP_ TIMESTAMP,ISOLATIONLEVEL INTEGER,LOCKTYPE 
INTEGER,CONSTRAINT SYS_PK_OJB_LOCKENTRY PRIMARY KEY(OID_,TX_ID))
CREATE TABLE OJB_NRM(NAME VARCHAR(250) NOT NULL PRIMARY KEY,OID_ 
LONGVARBINARY)
CREATE TABLE OJB_DLIST(ID INTEGER NOT NULL PRIMARY KEY,SIZE_ INTEGER)
CREATE TABLE OJB_DLIST_ENTRIES(ID INTEGER NOT NULL PRIMARY KEY,DLIST_ID 
INTEGER,POSITION_ INTEGER,OID_ LONGVARBINARY)
CREATE TABLE OJB_DSET(ID INTEGER NOT NULL PRIMARY KEY,SIZE_ INTEGER)
CREATE TABLE OJB_DSET_ENTRIES(ID INTEGER NOT NULL PRIMARY KEY,DLIST_ID 
INTEGER,POSITION_ INTEGER,OID_ LONGVARBINARY)
CREATE TABLE OJB_DMAP(ID INTEGER NOT NULL PRIMARY KEY,SIZE_ INTEGER)
CREATE TABLE OJB_DMAP_ENTRIES(ID INTEGER NOT NULL PRIMARY KEY,DMAP_ID 
INTEGER,KEY_OID LONGVARBINARY,VALUE_OID LONGVARBINARY)

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


Re: Any one using PostgreSQL and OJB ?

2004-04-02 Thread Robert S. Sfeir
Leandro Rodrigo Saad Cruz wrote:

I am. no problems.

 

Ditto, no issues, use it for almost all my projects unless client can 
pay for Oracle :-)

R

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


Re: OJB with Spring

2004-03-24 Thread Robert S. Sfeir
Angus Berry wrote:

I was wondering what you don't like about Hibernate? I have a couple of
OJB projects, but hear a lot of talk about Hibernate. Someone close to
Hibernate said that their caching was better.
I don't plan on switch anything, but I'd appreciate any insight from
folks who know both products.
This is based on comparison reading that I've done, not actual use.  
What I don't like is that they use their own SQL language, and I don't 
want to learn yet another SQL language, or I would use JDBC.  Their own 
query language is just a pain too as far as I'm concerned.  as an 
example to do a find:

List mates = sess.find(
   "select mate from Cat as cat join cat.mate as mate " +
   "where cat.name = ?",
   name,
   Hibernate.STRING
);
it's almost as much typing as SQL.

Now they've recently added ODMG3 support, and it does make it more 
interesting.

Like I said, the language seems easier for me in OJB.  I might be wrong.

R

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


OJB with Spring

2004-03-24 Thread Robert S. Sfeir
Has anyone successfully implemented OJB with the Spring framework, and 
can you tell me if you found that experience excruciatingly painful, 
easy, or what ever, and if found the results satisfactory?

I am considering a switch to Spring, but Hibernate is of no interest to 
me, and I would much rather not make the switch without OJB.

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


Re: Changing AutoRetrieve on the fly

2004-03-01 Thread Robert S. Sfeir
Armin Waibel wrote:

I can try to do that.  My CVS is from Friday night, is that too out 
of date?


No, should be ok. Do all PB-api test pass on your local system when 
run OJB test suite (ant junit) against default DB (hsql)?
Nope, some fail, but it doesn't look like they're in the same area I am 
hitting issues with.

junit-no-compile-no-prepare:
   [junit] Running org.apache.ojb.broker.AllTests
   [junit] Tests run: 347, Failures: 1, Errors: 0, Time elapsed: 39.767 sec
   [junit] TEST org.apache.ojb.broker.AllTests FAILED
   [junit] Running org.apache.ojb.odmg.AllTests
   [junit] [BOOT] INFO: OJB.properties: 
file:/C:/Documents%20and%20Settings/Robert%20S.%20Sfeir/My%
20Documents/projects/db-ojb/target/test/ojb/OJB.properties
   [junit] [BOOT] INFO: No value for key 'CollectionProxyClass'
   [junit] Tests run: 182, Failures: 1, Errors: 2, Time elapsed: 14.971 sec

   [junit] TEST org.apache.ojb.odmg.AllTests FAILED
   [junit] Running org.apache.ojb.soda.AllTests
   [junit] [BOOT] INFO: OJB.properties: 
file:/C:/Documents%20and%20Settings/Robert%20S.%20Sfeir/My%
20Documents/projects/db-ojb/target/test/ojb/OJB.properties
   [junit] [BOOT] INFO: No value for key 'CollectionProxyClass'
   [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 6.128 sec

   [junit] Running org.apache.ojb.otm.AllTests
   [junit] Tests run: 77, Failures: 0, Errors: 0, Time elapsed: 17.455 sec


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


Re: Changing AutoRetrieve on the fly

2004-03-01 Thread Robert S. Sfeir
Armin Waibel wrote:

Hi Robert,

Robert S. Sfeir wrote:

Armin?  Any other ideas on this?  I think it might be a serious bug 
we need to nail before 1.0.  My object does come back, but no values 
are being set.

Any help would be appreciated.


hmm, as I said in my previous mail all (retrieveReference) tests pass 
with latest CVS, so I think it's not a bug in OJB.
Did you try latest from CVS? Could you send my a junit test for your 
problem?


I can try to do that.  My CVS is from Friday night, is that too out of date?

R

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


Re: Changing AutoRetrieve on the fly

2004-03-01 Thread Robert S. Sfeir
Armin?  Any other ideas on this?  I think it might be a serious bug we 
need to nail before 1.0.  My object does come back, but no values are 
being set.

Any help would be appreciated.

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


Re: Changing AutoRetrieve on the fly

2004-02-29 Thread Robert S. Sfeir
I checked test suite and there are some test cases for 
'retrieveAllReferences' - all seems to work (Only difference is that you 
use refresh 'true' in reference-descriptor).

Can you verify your result with some logging entry before and after 
force loading method call?


I can, however I removed the refresh="true" and it still behaves the 
same.  ProjectBean is created its values are null.

What kind of logging do you want me to put in?

R

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


Re: Changing AutoRetrieve on the fly

2004-02-29 Thread Robert S. Sfeir
Armin Waibel wrote:

> Are you saying that as I do my for loop to build my view objects, I
> should grab each CategoryBean, and then get the references to it then?
yes, that's how it is work currently.

Maybe we should allow to override the auto-XXX settings on the fly by 
add setAutoXXX methods to query object or something similar in 1.1.
Would be a nice feature and would allow what you expected.
Yup. That would be real nice to have it turned on and off.  Think of it 
like AutoCommit.  Sometimes you want to set that to true, and sometimes not.

Ok let me ask a question another way, and perhaps the answer is the same...

What if I turn auto-retrieve to true by default and then turn on some 
setting so that it does do the retreiveAllReferences(), is this the same 
problem?

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


Re: Changing AutoRetrieve on the fly

2004-02-29 Thread Robert S. Sfeir
seems my previous mail is lost in space ;-)

Think you do the wrong order of commands. First retrieve the Category 
objects with a query. Then for all Category objects you want to assign 
references, call PB.retrieveAllReferences/retrieveReference.
Or do I misunderstand your post (sorry my bad english)?
Not bad at all, I understood... here is the code now... still doesn't 
work, the ProjectBean is created, but it's values are null:

final Query query = QueryFactory.newQuery( Category.class, crit );
 broker.beginTransaction();
 final List results = ( List ) broker.getCollectionByQuery( query );
 broker.commitTransaction();
 if( results.size() > 0 )
 {
   for( int i = 0; i < results.size(); i++ )
   {
 CategoryBean bean = ( CategoryBean ) results.get( i );
 broker.retrieveAllReferences( bean );
 CategoryDetailView categorySummary = 
CategoryDetailView.buildCategoryDetailView( bean );
 categories.add( categorySummary );
 categorySummary = null;
   }
 }

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


Re: Changing AutoRetrieve on the fly

2004-02-29 Thread Robert S. Sfeir
Armin Waibel wrote:

That's the first thing I tried, but it returns null for my objects, 
I must not be using the code Right!

Project p = new ProjectBean(); //TODO: Replace with Factory call.
broker.retrieveAllReferences( p );
final List results = ( List ) broker.getCollectionByQuery( query );
I don't know your ProjectBean class, but when you create a new object 
you can't find any reference object - or I'm wrong?

ah, I think you do the "wrong turn" and I misunderstood your example.

Do after retrieve of the Category objects a

final List results = ( List ) broker.getCollectionByQuery( query );
aCategoryObject = ...get from list
broker.retrieveAllReferences( aCategoryObject );
call to get all reference objects for all Category instances you want 
to assign with the appropriate references.
I think I know what you mean, but I'm confused about:

aCategoryObject = ...get from list

aCategoryObject do you mean my CategoryBean?

what do you mean ...get from list?

Are you saying that as I do my for loop to build my view objects, I 
should grab each CategoryBean, and then get the references to it then?

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


Re: Changing AutoRetrieve on the fly

2004-02-29 Thread Robert S. Sfeir
Armin Waibel wrote:

Hi,

Robert S. Sfeir wrote:

...

That's the first thing I tried, but it returns null for my objects, I 
must not be using the code Right!

Project p = new ProjectBean(); //TODO: Replace with Factory call.
broker.retrieveAllReferences( p );
final List results = ( List ) broker.getCollectionByQuery( query );
I don't know your ProjectBean class, but when you create a new object 
you can't find any reference object - or I'm wrong?
I should explain.

I am doing a select on Category.  a Category bean contains a get and set 
for a ProjectBean.  a Category only relates to one Project.  If I do the 
autoretrieve false then the projectBean object in the Category bean is 
null.  If I set it to true, then it correctly contains a ProjectBean 
which the category relates to.

Now sometimes I just want to get a list of categories, and I could care 
less that I get the ProjectBean with it, that's too heavy if I want to 
just display the category id and category name.  Other times I need to 
do the whole thing, like for a category detail view.  In that case I 
want to get all the ProjectBeans along with the category.

Does this makes sense?

So if I understood retrieveAllReferences, it will return all references 
of the object (ProjectBean) which relate to the category based on the 
fact that the Query object is querying Category.class.

R

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


Re: Changing AutoRetrieve on the fly

2004-02-29 Thread Robert S. Sfeir
Armin Waibel wrote:

Hi Robert,

Robert S. Sfeir wrote:

I have auto-retreive set to false in all my descriptors currently.  
Reason I do that is because sometimes I am not interested in getting 
the related objects, I just want to do a select from the table and 
just get the data back.

However, there are times when I do want to fetch the related 
objects.  So with that, I tried the following code below, but it 
seems that it's incorrect since my bean still returns a null for the 
related bean.

final Query query = QueryFactory.newQuery( Category.class, crit );
 broker.beginTransaction();
 final ObjectReferenceDescriptor ord = new 
ObjectReferenceDescriptor( broker.getClassDescriptor( Project.class ) );
 ord.setCascadeRetrieve( true );


OJB couldn't watch your made changes, 'ord' instance was not integrated.
Why you don't use
PB.retrieveAllReferences
PB.retrieveReference
for these objects you want to know the reference objects?
That's the first thing I tried, but it returns null for my objects, I 
must not be using the code Right!

Project p = new ProjectBean(); //TODO: Replace with Factory call.
broker.retrieveAllReferences( p );
final List results = ( List ) broker.getCollectionByQuery( query );
Any help is appreciated.
R
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Changing AutoRetrieve on the fly

2004-02-29 Thread Robert S. Sfeir
I have auto-retreive set to false in all my descriptors currently.  
Reason I do that is because sometimes I am not interested in getting the 
related objects, I just want to do a select from the table and just get 
the data back.

However, there are times when I do want to fetch the related objects.  
So with that, I tried the following code below, but it seems that it's 
incorrect since my bean still returns a null for the related bean.

final Query query = QueryFactory.newQuery( Category.class, crit );
 broker.beginTransaction();
 final ObjectReferenceDescriptor ord = new 
ObjectReferenceDescriptor( broker.getClassDescriptor( Project.class ) );
 ord.setCascadeRetrieve( true );
 final List results = ( List ) broker.getCollectionByQuery( query );
 broker.commitTransaction();

I have a foreign key relationship between Category and Project.  I was 
to select categories in this case and also get the Project objects back 
with it.  Project and Category are Interfaces.


 


 
 
 
 
 
   
 


Thanks

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


Re: OJB + MSSQL sp_executesql problem

2004-02-26 Thread Robert S. Sfeir
Yeah, and further, is seems that the MSSQL MS Driver can't deal with 
sets in an unordered order of fields, meaning if the DB has, id name age 
height, and you do sets in the order of id age name height, the driver 
will choke and complain.  How lame is that?

You might want to take a look at this driver, granted it's still beta, 
but we've had good results with it:

http://sourceforge.net/projects/jtds/

R

Charles Anthony wrote:

Hi Alex,

Very simply, OJB does not issue the sp_executesql statement; the Microsoft
JDBC driver does ! OJB just issues the "SELECT" statement.
I would strongly suggest that you look to using a different MSSQl JDBC
Driver[1]; about a year ago I did a comparative benchmark of JDBC Drivers
for MS SQL, looking at Microsoft, DataDirect, JSQLConnect and Opta2000. For
the area of code in our app that I benchmarked, the Microsoft driver was by
far the slowest, and Opta2000 was 50% faster. [2] I posted my results to the
list, so they should be in the archive somewhere.
The "indexed" attribute in the XML repository has no significance to the OJB
runtime; it is there so that table schemas (or DDL) can be generated from
the repository.
In short, if you have to use the Microsoft driver, it's probably worth
asking around on their forums to see if anyone there has encountered this
issue.
Cheers,

Charles

[1] It's advice my employer doesn't actually follow ! 
[2] As with all benchmarks, your mileage WILL vary in your app; don't rely
on my comparisons, do your own benchmarks.

 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 26 February 2004 02:13
To: [EMAIL PROTECTED]
Subject: OJB + MSSQL sp_executesql problem
Hello everyone ! 

I have been using OJB for the last several months in several 
projects and 
have had no problems at all - great product ! However, in the last 
project, I am having problems with the sp_executesql 
statement that is 
generated by OJB in the queries.  It apparently is a problem 
with my mssql 

installation, but I am looking for a workaround without having to do 
anything major with the database. 

A couple of lines about my db setup:
1. OJB rc5, jdk 1.4.2
2. mssql database - the table that I am having a problem with 
is quite 
large - 60 million rows. 

The problem is that it takes about 20 seconds to run a query 
to retrieve a 

record from the database. When I look at the generated code, 
the query is 
of the form 'sp_executesql SELECT ... from ... WHERE 
DCN=..'. If I run 

the query directly in the MSSQL query analyzer, it takes just 
as  long (so 

apparently the problem is not with anything in OJB). However, 
if I take 
the query out of the 'sp_executesql..' statement, and run it 
as a regular 
select query (e.g. only "SELECT ... from ... WHERE 
DCN=..), it takes 
less than a second to run.  I investigated my set up and it 
appears that 
for some reason mssql messes up the indexes on the table - instead of 
using the clustered index that is specified on the field on which I 
specify the WHERE condition (e.g. 'DCN' in the sample query snippet 
above), it uses the index on the primary key (e.g. the Id 
field). When the 

query is run as a literal (second example below) - everything 
works like a 

charm and mssql selects the correct index. 

As you can see below, I thought that if I indicated in the 
repository that 

the DCN column was indexed, it would resolve the issue; however, the 
indexed="true" property does not seem to change the generated 
sp_executesql statement in any way. 

So, my question is, is there a way to make mssql use the 
right index with 
some property in the configuration (e.g. that would possibly 
pass an index 

hint to the query)  ? Has anyone else encountered similar behaviour ? 

Sample code: 

The repository-user.xml
... 
  
   

access="readonly" autoincrement="true" primarykey="true"/>
   
   
   
   
 

The generated query (runs for about 15 - 20 seconds): 

exec sp_executesql N'SELECT 
A0.DCN,A0.Batch_Name_IA,A0.CreateDate,A0.Box_No,A0.ID FROM 
Claim_Export_Summary A0 WHERE A0.DCN =  @P1 ', N'@P1 
nvarchar(4000) ', 
N'0121110452'

Literal query (runs for less than a second): 
SELECT A0.DCN,A0.Batch_Name_IA,A0.CreateDate,A0.Box_No,A0.ID FROM 
Claim_Export_Summary A0 WHERE A0.DCN =  '0121110452'

Regards,

Alex Kotchnev
Developer / Systems Analyst
Diversified Information Technologies
++
++
CONFIDENTIALITY NOTICE: If you have received this e-mail in 
error, please 
immediately notify the sender by e-mail at the address shown. 
This e-mail 
transmission may contain confidential information.  This 
information is 
intended only for the use of the individual(s) or entity to 
whom it is 
intended even if addressed incorrectly.  Please delete it 
from your files 
if you are not the intended recipient.  Thank you for your compliance.
+

Re: OJB + MSSQL sp_executesql problem

2004-02-26 Thread Robert S. Sfeir
Clute, Andrew wrote:

We were using the jTDS driver for awhile to, with decent results --
except that it is not JDBC 2.0 compliant. It states that it is, but it
is missing quite a few features -- mostly notably scrollable resultsets.
So, if you do any paging work at all, I have found the jTDS driver to be
orders of magnitude slower because it has to iterate though the entire
result set.
We are now using the Merila driver from i-net, to much success.
 

I do most of my paging stuff using displaytag, no need for scrollable 
resultsets.  That said I would love to get a link to that driver to 
evaluate it.  MSSQL is not my favorite DB, but hey people use it, and 
who am I to tell them not to.

R

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


Re: OJB + MSSQL sp_executesql problem

2004-02-26 Thread Robert S. Sfeir
Clute, Andrew wrote:

I am not sure what you mean my 'displaytag' -- could explain that more?
I am curious how that limits the resultset returned from the database.
 

it doesn't but if you do it right, you get all the results and use it to 
iterate over your collection.

http://www.displaytag.org/index.jsp

As for the driver, here it is:

http://www.inetsoftware.de/English/produkte/JDBC_Overview/ms.htm
 

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


Re: deploy OJB with web application

2004-02-23 Thread Robert S. Sfeir
Thomas Dudziak wrote:

On Mon, 23 Feb 2004, marc salvetti wrote:

 

Thank you very much for this info,
i will try to install resin on my local computer to check if it works with 
theses properties. 
But for now, i'm still stuck because i can't ask my isp to change the resin 
config, as i guess it could make problems with other people app.
   

I'm not so sure about that. AFAIK, Resin allows you to put some 
non-standard (proprietary) config properties in the web.xml of your
webapp. You should definitly check the doc about that.

BTW it is always better to develop/debug a webapp using a local servlet
container first (if possible) as it gives you much more freedom for
experimentation and debugging.
 

Actually you can put it in resin-web.xml, inside the WEB-INF along with 
web.xml and resin will merge both on startup, so that might be a place 
to try it.

R

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


Re: deploy OJB with web application

2004-02-23 Thread Robert S. Sfeir
marc salvetti wrote:

Thank you very much for this info,
i will try to install resin on my local computer to check if it works with 
theses properties. 
But for now, i'm still stuck because i can't ask my isp to change the resin 
config, as i guess it could make problems with other people app.

 

Honestly your ISP shouldn't have updated to the latest resin for no real 
good reason.  R3.0.6 has not even been out a month!

R

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


Re: Autoincrement field

2004-02-22 Thread Robert S. Sfeir
Bilge Erkan wrote:

Hello,

I want to use an autoincrement field which is at the same time a primary
key in a table in MySQL database. I think I have two choices for this in
 OJB.
1) I will either set the related field descriptor in repository with
autoincrement true and set the field in the database table as an integer
field,
2) or set the field in the database table as an autoincrement
integer field and not use the autoincrement attribute in the field
descriptor.
Which way is better?
#1, unless you're only going to use one DB ever and never change to 
another DB.  If you plan on making things work with multiple DBs, than 
you pretty much have to use #1 because you can't guarantee a DB will 
have an autoincrement value, and you don't know how you can get the 
value out of autoincrement, since each DB will be different.

R

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


Re: deploy OJB with web application

2004-02-22 Thread Robert S. Sfeir
I told you guys there was problems with resin 3.0.6 and parsin the 
repository class :-)

Scott Ferguson at caucho fixed it for the next build, but that's not out 
yet.  It works fine in 3.0.4.

R

Thomas Dudziak wrote:

On Sun, 22 Feb 2004, marc salvetti wrote:

 

Tom, i finally got shell access from my isp, here is the interesting part of the 
log :

[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: > 
reference-descriptor
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  name: 
rootMessage
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  class-ref: bo.
ForumMessage
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  proxy: null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  
proxy-prefetching-limit: null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  refresh: null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  auto-retrieve: 
null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  auto-update: 
null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  auto-delete: 
null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:  otm-dependent: 
null
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: > foreignkey
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG:   field-ref: 
rootMessageID
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: < foreignkey
[org.apache.ojb.broker.metadata.RepositoryXmlHandler] DEBUG: < 
reference-descriptor

since the default value for auto-retrieve is true, do you think the 
auto-retrieve:null might be the cause of the problem ?
and if so, is it a resin problem or an ojb problem ?
   

There seems to be some trouble with parsing the class descriptor (and
probably other parts of the configuration) which is likely to be some
problem with the combo resin + ojb. Are there other messages from ojb like
'... not found, using default values' or somesuch ?
If you can, then you should try this with a local installation of resin
3.0.6 (should be no problem as you're allowed to use resin free of charge
for development) or if you do not use specific features of resin, another
servlet container like jetty or tomcat might do. This will enable you to
debug this issue, and you can see where the problem is located (path
issues, xml parsing problems etc.).
Tom

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


Re: Oracle date tip

2004-02-20 Thread Robert S. Sfeir

I may well have...  I always figured that since you can't make a 
column in an Oracle table of type "timestamp" that it was just an 
Oracle quirk.  Or, to avoid sticking my neck out too far again, 
whenever I tried using "timestamp" as a column type in my Oracle 
databases, I've gotten an error.

In any case, it seems like everyone who is used to writing Oracle SQL 
is used to using the "to_date" function to make sure that their String 
representations use correct date formats, and it seems like one 
shouldn't have to change a database-level setting to make OJB work.  
There should be an application-layer place to make it work.
Actually, at the risk of getting pelted with tomatoes...  Since my work 
is pretty much always in Java, and Java and dates/sql date are a pain to 
deal with/convert sometimes, I just convert all my dates to Long(s) 
(time in millis) and store them in the DB as such.  For Oracle I use 
NUMBER, for Postgres Integer etc...  So when I get the data back, I 
don't have to do anything DB special, I just convert the date from Long 
to a Date String and pass it to the view, the conversion requires less 
steps, and is more consistent..  This also makes it very cool to 
calculate date diffs etc, and I find the app to be much more portable 
between DBs.

It might be different, and perhaps unconventional, but it's worked like 
a charm.

R

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


Re: Oracle date tip

2004-02-19 Thread Robert S. Sfeir
Joe Germuska wrote:

At 6:02 PM -0500 2/19/04, Andy Malakov wrote:

Brad,

I do not think it is OJB/JDBC problem.

What is strange about your mail is the fact that NLS_DATE_FORMAT 
fixed the problem  - instead of NLS_TIMESTAMP_FORMAT. Since you
applied JavaDate2SqlTimes converter - all your dates at JDBC level 
should have been converted to java.sql.Timestamp.

Please do not be confused by the way P6SPY displays generated JDBC 
query (it may be approximate).


Oracle doesn't have a TIMESTAMP type; its "DATE" encompasses SQL TIME, 
TIMESTAMP, and DATE.


No I think you misunderstood the meaning of TIMESTAMP with Oracle in 
this case.  With MySQL for example Timestamp column is just that a 
timestamp from the DB, nothing you can insert into, like an auto date 
column.  In Oracle timestamp contains the date AND time in the field, 
where as the date field contains just the date.

R

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


Re: Sanity Check on Sharing PersistenceBroker

2004-02-18 Thread Robert S. Sfeir
McCaffrey, John G. wrote:

you may want to create a threaded test to demonstrate concurrent usage.
What will happen when you need a transaction to span multiple tables?
 

I do that now, and I don't get that error because I am withing the 
transaction most of the time.  When I am not, I do another begin/end 
transaction block and I don't get errors.  When I get an exception, I 
always check to see if I am in transaction and do a rollback.

Will you get "already in a tranaction" errors?
 

Nope, not so far.

You may want to have your getBroker() method return a new instance
 

Yup, this is why I'm asking to see if the gurus on this list know 
whether this is necessary of it PB is smart enough to deal with it 
correctly.

R

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


Sanity Check on Sharing PersistenceBroker

2004-02-18 Thread Robert S. Sfeir
I'm integrating OJB as tightly as I can with my Struts app, and have 
written a class which implements the Struts PlugIn API.  In that class, 
when the Struts app starts up, it calls the init() method.  In that init 
method I make some calls to open a DB connection and get a 
PersistenceBroker.

Example follows:

   private final static void openDB()
 {
   try
   {
 if( getOjbDBAlias() == null || getOjbDBAlias().length() == 0 )
 {
   throw new PersistenceBrokerException( "OJB Alias Value Cannot be 
null!  Please set it properly before proceeding." );
 }
 LOGGER.log( Level.INFO, "Opening PersistenceBroker Database 
Instance." );
 setBrokerKey( new PBKey( getOjbDBAlias() ) );
 setBroker( PersistenceBrokerFactory.createPersistenceBroker( 
getBrokerKey() ) );
 LOGGER.log( Level.FINE, "PersistenceBroker Data Access Layer 
ready!" );
   }
   catch( PBFactoryException e )
   {
 LOGGER.log( Level.SEVERE, "A PBFactoryException was thrown: " + 
e.getMessage() + "\n\n" );
   }
   catch( PersistenceBrokerException e )
   {
 LOGGER.log( Level.SEVERE, "An PersistenceBrokerException Occured 
while opening the database connection: " + e.getMessage() );
   }
 }

Easy enough, now once the app is started, there is only one method in 
the class file which can be used from my DAO layer and that is getBroker().

My question is:

Am I doing this as expected, or am I going to get in trouble for using 
the same broker instance for all DAO calls?

The way I would use this persistence broker is, for example:

   broker.beginTransaction();
 final Query query = QueryFactory.newQuery( Acronym.class, crit );
 results = ( List ) broker.getCollectionByQuery( query );
 broker.commitTransaction();
I don't close the broker of course.  Am I going to hit some locking 
issues here, or is one broker enough to handle getting connections from 
DB and handle multiple simultaneous calls?

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


Re: deploy OJB with web application

2004-02-16 Thread Robert S. Sfeir
Thomas Dudziak wrote:

On Mon, 16 Feb 2004, marc salvetti wrote:

 

well in fact i don't have much choices as i don't control my host computer and 
resin versions
   

I wonder why this should have anything to do with resin ? From what you
posted it seems more like a problem with the XML parser, as the
isolation-level (which you probably didn't specify at first) wasn't
read. If you don't specify an attribute value, the XML parser is supposed
to fetch the default value from the DTD (if it exists), and if there is no
default value (because e.g. it's CDATA) then a null is returned.
So could it be that you either use an old repository.dtd (where there is
no isolation-level attribute declared), or that the XML parser does not
find the DTD (and is not configured to complain) ?
You might want to try putting 'http://db.apache.org/ojb/repository.dtd' as
the DTD location into your repository.xml.
Tom

 

Nope, I went through all that, clean install of everything, even outside 
my app.  Scott Ferguson at Caucho figured it out and fixed it.  It was 
the parser failing in a certain way, he's accounted for it.  That same 
setup working fine in Tomcat 5.

R

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


Re: deploy OJB with web application

2004-02-16 Thread Robert S. Sfeir
marc salvetti wrote:

Robert S. Sfeir  codepuccino.com> writes:

 

Don't spin your wheels, I've already filed a bug with resin 3.0.6 where 
the repository won't parse right.  Scott fixed it already for the next 
release, in the mean time use 3.0.4, it works fine.

R

   



well in fact i don't have much choices as i don't control my host computer and 
resin versions
 

You should tell your ISP then, because short of the OJB team figuring 
out their own workaround, and I don't think they should because the 
problem is in the parser not OJB, you're pretty much stuck until Scott 
Ferguson releases a build and your ISP upgrades to it.

R

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


Re: deploy OJB with web application

2004-02-16 Thread Robert S. Sfeir
Don't spin your wheels, I've already filed a bug with resin 3.0.6 where 
the repository won't parse right.  Scott fixed it already for the next 
release, in the mean time use 3.0.4, it works fine.

R

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


Performance of JDO?

2004-02-15 Thread Robert S. Sfeir
I got the links to look at the performance of PersistenceBroker v/s 
Native JDBC v/s ODMG, but there seems to be no link for JDO.  Can anyone 
give me an idea of how far off the JDO impl is as compared to PB?  
Because of the performance stuff I saw on the page, I converted 
(happily) my Transaction(s) to PersistenceBroker(s), and in face the app 
is much snappier (what do you expect from an almost 5X speed diff?).  I 
am simply curious about JDO because it would be interesting to use it, 
but not if it's slower than PB, and use it because perhaps it might 
allow me to move my code between various other products without having 
to rewrite anything.

Just curious.

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


Re: WebSphere compatibility?

2004-02-11 Thread Robert S. Sfeir
Yannick Goujon wrote:

Is Websphere 4.0.7 (solaris) compatible with OJB using datasource or do we
need to upgrade to websphere 5?
 

FWIW, I haven't seen compatibility issues with any app server I've used 
and tested with, and OJB is ONE of the reasons why I've gone that route, 
it removes weird app server specific datasource setups.  Even using 
Struts, I never setup a datasource in the struts-config.xml, everything 
is done with OJB.  I can switch app servers by simply deploying my war 
file and I'm up and running.

R

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


Re: Criteria with select with no where clause?

2004-02-04 Thread Robert S. Sfeir
Hennebelle wrote:

Hi,

You can create an empty criteria and not had clauses, like this :

Criteria criteria = new Criteria();
Query query = QueryFactory.newQuery(SitBO.class, criteria);
 

heh, thanks not real obvious.

R

-Message d'origine-
De : Robert S. Sfeir [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 4 février 2004 05:17
À : OJB Users List
Objet : Criteria with select with no where clause?
Can't seem to find a method which would allow me to add a criteria to
return all records in a table.  select * from table without where
clause... what's the trick?
R

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


Criteria with select with no where clause?

2004-02-03 Thread Robert S. Sfeir
Can't seem to find a method which would allow me to add a criteria to 
return all records in a table.  select * from table without where 
clause... what's the trick?

R

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


FYI about Resin 3.0.6 and repository.xml

2004-01-30 Thread Robert S. Sfeir
After much digging around for issues with repository.xml throwing 
exceptions on init of the OJB repository, I've discovered that the 
validator in 3.0.6 has some bug in it which causes repository.xml not to 
parse right and fail startup.  Resin 3.0.4 doesn't have this problem.  
I've made Scott Ferguson at Caucho aware of the issue and he's looking 
into it.

Hope this helps others.

R

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


Using Oracle Lobs

2003-12-23 Thread Robert S. Sfeir
Hey guys.

I was looking in the docs for hints on how to use Oracle LOBs.  I an
interested in CLOB right now, but will need BLOB later for image and
document storage.  Is there any quick guide/hint out there on how to do
this?  How will this differ from using text and longvarchar or longbinary
in other databases?

R

-- 
Robert S. Sfeir
[EMAIL PROTECTED]

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



Re: SQLException Socket Closed with Oracle 9 and RC5

2003-12-19 Thread Robert S. Sfeir
ions.SearchAction.execute(SearchAction.java:68)
> at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
> at
> com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:113)
> at
> com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:190)
> at
> com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:177)
> at
> com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
> at
> com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253)
> at
> com.caucho.server.port.TcpConnection.run(TcpConnection.java:305)
> at com.caucho.util.ThreadPool.run(ThreadPool.java:273)
> at java.lang.Thread.run(Thread.java:534)
> org.apache.ojb.broker.PersistenceBrokerSQLException:
> java.sql.SQLException: Io exception: Socket closed
> at
> org.apache.ojb.broker.accesslayer.StatementsForClassImpl.getPreparedStmt(Unknown
> Source)
> at
> org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement(Unknown
> Source)
> at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(Unknown
> Source)
> at org.apache.ojb.broker.accesslayer.RsIterator.(Unknown
> Source)
> at
> org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unknown
> Source)
> at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown
> Source)
> at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown
> Source)
> at
> gov.hhs.acronyms.sql.AcronymDAO.selectAcronyms(AcronymDAO.java:80)
> at
> gov.hhs.acronyms.actions.SearchAction.execute(SearchAction.java:68)
> at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
> at
> com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:113)
> at
> com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:190)
> at
> com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:177)
> at
> com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
> at
> com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253)
> at
> com.caucho.server.port.TcpConnection.run(TcpConnection.java:305)
> at com.caucho.util.ThreadPool.run(ThreadPool.java:273)
> at java.lang.Thread.run(Thread.java:534)
> Caused by: java.sql.SQLException: Io exception: Socket closed
> at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
> at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
> at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
> at
> oracle.jdbc.driver.OracleStatement.(OracleStatement.java:389)
> at
> oracle.jdbc.driver.OracleStatement.(OracleStatement.java:413)
> at
> oracle.jdbc.driver.OraclePreparedStatement.(OraclePreparedStatement.java:119)
> at
> oracle.jdbc.driver.OraclePreparedStatement.(OraclePreparedStatement.java:92)
> at
> oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:950)
> at
> oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:802)
> at
> org.apache.ojb.broker.accesslayer.StatementsForClassImpl.prepareStatement(Unknown
> Source)
> at
> org.apache.ojb.broker.accesslayer.StatementsForClassImpl.prepareStatement(Unknown
> Source)
> ... 30 more
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
Robert S. Sfeir
[EMAIL PROTECTED]

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



Re: Contributing code and fixes

2003-11-21 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Yes, either way it's better than creating a new Boolean when it's
clearly not needed.
Also Boolean.value(...) is better in my opinion just in case it's ever
changed by Sun.  :-\
R

Jim Moore wrote:
| Boolean.valueOf(..) returns the same thing, but explicitly saying
| Boolean.TRUE is definately both clearer AND faster.  The fact that Boolean
| even has a public constructor is a bug (that Sun readily admits to).
|
|
| - Original Message -
| From: "Hal Arnold" <[EMAIL PROTECTED]>
| To: "OJB Users List" <[EMAIL PROTECTED]>
| Sent: Friday, November 21, 2003 10:26 AM
| Subject: RE: Contributing code and fixes
|
|
| Wouldn't:
|
| Boolean b = Boolean.TRUE;
|
| be even better (uses the immutable version) and clearer?
|
| hba
|
| -Original Message-
| From: Robert S. Sfeir [mailto:[EMAIL PROTECTED]
| Sent: Friday, November 21, 2003 9:57 AM
| To: OJB Users List
| Subject: Re: Contributing code and fixes
|
|
| I don't have it right now, but I ran some performance inspections
| yesterday and one of them that popped out was that there was a few spots
| where a Boolean was initialized as:
|
| private static Boolean b = new Boolean(true);
|
| whereas I would do it as:
|
| private static final Boolean b = Boolean.valueOf(true);  // better
| performance
|
| Further there were spots where arrays were being copied manually, and
| System.arraycopy() should be used since it's faster.
|
| Finally (no pun inteded) when a method is called like public
| Identity(Class realClass, Class topLevel, Object[] pkValues) all 3 of
| those parameters can have the final modifier.  It's better coding since
| it prevents something from changing the value submitted when it's not
| supposed to be changed.
|
| I didn't ding in a lot, but there was so much more I could look at, and
| I think I will.  IDEA with the Inspections Gadget plugin can run some
| 100 inspections on the code, it doesn't mean they all need to be
| changed, but it's always worth looking at them to improve code
| readability, performance and security.
|
| Just my opinion.
|
| R
|
| Jakob Braeuchi wrote:
| | hi robert,
| |
| | Robert S. Sfeir wrote:
| |
| | Hi,
| |
| | I was wondering what the process is to contribute fixes.
| |
| | I've checked out the code from CVS, and opened a new project in IntelliJ
| | IDEA and was running some code inspections, and there are A LOT of
| | things that can be done to improve performance, clean up java docs,
| | unnecessary casts, method which can me marked final which are not,
| | unused methods,  and much much more.  Of course I wouldn't go just
| | changing this stuff at will, I'd be changing and testing locally.
| |
| |
| |> i use eclipse to indicate and fix those problems. i'm removing
| |> unnecessary cast, imports and the like from time to time in the
| |> main-classes but  NOT in the test-classes.
| |
| |> can you please post where intellij would do additional cleanups ?
| |
| |> jakob
| |
| |
| | So my question is, before I embarq into such a fairly involved process:
| | 1- Is this something the commiters are interested in?
| | 2- Once I make the changes who wants the code?
| | 3- What is the minimum JDK we're checking builds against?
| |
| | Thanks
| | R
| |>
| |>
| -
| 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]
- -
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/vl4O+cV9vuB27SARAomNAJ9yvmlOP/FId+CEGemPyImvLVfdygCeKC2z
fiz1Tc9DVcoA2LGNYdbYgXo=
=rdQk
-END PGP SIGNATURE-


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


Re: Contributing code and fixes

2003-11-21 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I don't have it right now, but I ran some performance inspections
yesterday and one of them that popped out was that there was a few spots
where a Boolean was initialized as:
private static Boolean b = new Boolean(true);

whereas I would do it as:

private static final Boolean b = Boolean.valueOf(true);  // better
performance
Further there were spots where arrays were being copied manually, and
System.arraycopy() should be used since it's faster.
Finally (no pun inteded) when a method is called like public
Identity(Class realClass, Class topLevel, Object[] pkValues) all 3 of
those parameters can have the final modifier.  It's better coding since
it prevents something from changing the value submitted when it's not
supposed to be changed.
I didn't ding in a lot, but there was so much more I could look at, and
I think I will.  IDEA with the Inspections Gadget plugin can run some
100 inspections on the code, it doesn't mean they all need to be
changed, but it's always worth looking at them to improve code
readability, performance and security.
Just my opinion.

R

Jakob Braeuchi wrote:
| hi robert,
|
| Robert S. Sfeir wrote:
|
| Hi,
|
| I was wondering what the process is to contribute fixes.
|
| I've checked out the code from CVS, and opened a new project in IntelliJ
| IDEA and was running some code inspections, and there are A LOT of
| things that can be done to improve performance, clean up java docs,
| unnecessary casts, method which can me marked final which are not,
| unused methods,  and much much more.  Of course I wouldn't go just
| changing this stuff at will, I'd be changing and testing locally.
|
|
|> i use eclipse to indicate and fix those problems. i'm removing
|> unnecessary cast, imports and the like from time to time in the
|> main-classes but  NOT in the test-classes.
|
|> can you please post where intellij would do additional cleanups ?
|
|> jakob
|
|
| So my question is, before I embarq into such a fairly involved process:
| 1- Is this something the commiters are interested in?
| 2- Once I make the changes who wants the code?
| 3- What is the minimum JDK we're checking builds against?
|
| Thanks
| R
|>
|>
- -
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/vlHA+cV9vuB27SARAgU2AKCMBrygMm8aJwXO/6wvZh5HH58sLACffa/q
G2TdNKlF0S3efRRDlVLG7O4=
=7p4f
-END PGP SIGNATURE-


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


Re: Contributing code and fixes

2003-11-20 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Trying to compile the code and I can't.  This is really my first time
nosing into someone else's open source project.
One of the reasons I can't compile is because of code blocks like this one:

/**
~ * creates an Identity from a class and the objects primary key values.
~ * used for the definition of proxies.
~ *
~ * @param realClass the concrete class of the object, or null if not
known.
~ * @param topLevel the highest persistence-capable class or
~ * interface (in the inheritance hierarchy) that the identified
object is an instance of
~ * @param pkValues (unique across the extents !)
~*/
~public Identity(Class realClass, Class topLevel, Object[] pkValues)
~{
~m_objectsTopLevelClass = topLevel;
~m_objectsRealClass = realClass;
~m_pkValues = pkValues;
~checkForPrimaryKeys();
~}
The problem is that checkForPrimaryKeys() throws
ClassNotPersistenceCapableException, but it's not handled in the code
above either by throw or by catch.
Am I missing some kind of setup?  The imports don't show up in red, so
it can actually find all the source files fine.
Any help would be great, perhaps I caught the HEAD in a state of flux?

Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/vWEw+cV9vuB27SARAua5AJ97PIQoSDW3YZ+JsGqxQPnq0hLPcACffpjD
oLZw8GCzPljDCZ6D1ZMYbQg=
=O6N9
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Contributing code and fixes

2003-11-20 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi,

I was wondering what the process is to contribute fixes.

I've checked out the code from CVS, and opened a new project in IntelliJ
IDEA and was running some code inspections, and there are A LOT of
things that can be done to improve performance, clean up java docs,
unnecessary casts, method which can me marked final which are not,
unused methods,  and much much more.  Of course I wouldn't go just
changing this stuff at will, I'd be changing and testing locally.
So my question is, before I embarq into such a fairly involved process:
1- Is this something the commiters are interested in?
2- Once I make the changes who wants the code?
3- What is the minimum JDK we're checking builds against?
Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/vV6S+cV9vuB27SARAmJCAJ9e0Pf4Y61NDlKo1g2Cp85PG2bNUQCfSN97
VBhaYbUYufDhBJ2IOjgW7Aw=
=XrCk
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Someone PLEASE help with double insert issue [RESOLVED]

2003-11-18 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Brian the only place I set it, as you can see from my code, *IS* within
the transaction.  Other wise I would have set it in the action which
calls this method.  I could not find another way to get the insert to
work.  As you could see from my explanation, setting the user_id in the
UserInfoBean would still make UserInfoBean think the ID was empty, hence
I figured something about the transaction was breaking the state
somehow.  I don't know what's going on under the hood, I honestly
haven't looked.
But I understand your point and I agree, there is no need to do this
outside the transaction boundary.
Thanks for your suggestion though, it's what triggered the solution.
R
Brian McCallister wrote:

| On Tuesday, November 18, 2003, at 06:35 PM, Robert S. Sfeir wrote:
|
|> Second, you can't just set the userID like I did, you have to pass the
|> full bean of the first table to the second table.
|
|
| Be careful, you don't *need* to set it to maintain integrity outside of
| the transaction boundary, but if both of them are in fact state on the
| object I *would* be sure to set them at the same time so that the object
| state is consistent within the transaction boundaries. Particularly in
| the case of container managed transactions (this isn't necessarily EJb
| containers, I do it in web containers) where something else may be using
| the same object within the same transaction.
|
| I am glad it was solved!
|
| -Brian
|
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uruS+cV9vuB27SARAuWeAJ0eGiHLkX9awZBwGE4j5+TCsbphdgCgqzPg
4DawPQFEeV3+9Lbh2c5UeE8=
=B/r4
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Transaction blocks in selects

2003-11-18 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi, I was looking at the examples in the tutorial and it seems that even
for doing a select, which is not going to be followed by an update or
delete, OJB seems to indicate that we need to do:
tx.begin();
... do select stuff here
tx.commit();
However I tested this with no begin and commit blocks and it seems to
work fine, as I would expect.  In JDBC one never really does any kind of
transactions when doing selects only.  Is there a reason why we need to
begin and end a transaction in selects?  Doesn't that also affect
performance?
Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/urXE+cV9vuB27SARAmoPAKC2TUGr2hmrihRDFuE16xb20YjXLQCdGQHM
VqUOPxuRdnoR1iYyEF/+fxo=
=BFoe
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Someone PLEASE help with double insert issue [RESOLVED]

2003-11-18 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
That catch Exception is wrong, you should be catching
PersistenceBrokerException... catching Exception is not a good thing,
and it was there because I wanted to see everything that would get thrown.
R

Robert S. Sfeir wrote:

| Thanks to everyone who helped.
|
| Some things that others might need to know if they want to do one insert
| for a full transaction...
|
| First, you don't need an auto increment row in the second table, you do
| need a primary key and a foreign key definition.
|
| Second, you can't just set the userID like I did, you have to pass the
| full bean of the first table to the second table.
|
| Third, you DON'T need anonymous access, that's a misnomer, everything
| works fine without it.  So in the end, here is what my code looks like.
| ~ I wonder if I should be on the hook to write a quick tutorial on how to
| do this.  I can do this with both ODMG and PersistenceBroker APIs now.
 :-)
|
| The Insert:
| public final void addRegistration( final UserInfoBean user, final
| UserLoginBean userLoginBean )
| throws DataAccessException
| {
| final PersistenceBroker broker =
| PersistenceBrokerFactory.defaultPersistenceBroker();
| try
| {
| LOGGER.log( Level.FINEST, "Transaction open in " +
| RegistrationDAOImpl.class.getName() );
|
| broker.beginTransaction();
| broker.store( user );
| userLoginBean.setUserInfoBean( user );
| broker.store( userLoginBean );
| broker.commitTransaction();
| }
| catch( Exception tab )
| {
| broker.abortTransaction();
| tab.printStackTrace();
| throw DataAccessException.datastoreError( tab );
| }
| }
|
| What fixed it: userLoginBean.setUserInfoBean(user);  is what makes it work
| What broke it: userLoginBean.setUserID(user.getUserID()) fails! it wants
| the whole user bean after insert.  (Dunno why, perhaps someone can
explain)
|
| Descriptors:
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|
| What was wrong: nothing
| What you don't need to do: access anonymous, or have an auto increment
| key in both tables, not needed.  Only in one to get the id you want to
| insert in the first place.
|
| Struts specific action simply sets the info in both beans and passes
| them down.
|
| I would not mind writing a tutorial on how to do this with both ODMG and
| PersistenceBroker.  They're both almost the same.
|
| Hope this helps someone else some day.
|
| R
- -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/urDN+cV9vuB27SARAs/jAKDzh0Y2S1vHymCtCAtXy+iJKdMm8ACggAMe
3sovd/au0Two/kaXQ42KU3Y=
=7SYs
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Someone PLEASE help with double insert issue [RESOLVED]

2003-11-18 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Thanks to everyone who helped.

Some things that others might need to know if they want to do one insert
for a full transaction...
First, you don't need an auto increment row in the second table, you do
need a primary key and a foreign key definition.
Second, you can't just set the userID like I did, you have to pass the
full bean of the first table to the second table.
Third, you DON'T need anonymous access, that's a misnomer, everything
works fine without it.  So in the end, here is what my code looks like.
~ I wonder if I should be on the hook to write a quick tutorial on how to
do this.  I can do this with both ODMG and PersistenceBroker APIs now.  :-)
The Insert:
public final void addRegistration( final UserInfoBean user, final
UserLoginBean userLoginBean )
throws DataAccessException
{
final PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
try
{
LOGGER.log( Level.FINEST, "Transaction open in " +
RegistrationDAOImpl.class.getName() );
broker.beginTransaction();
broker.store( user );
userLoginBean.setUserInfoBean( user );
broker.store( userLoginBean );
broker.commitTransaction();
}
catch( Exception tab )
{
broker.abortTransaction();
tab.printStackTrace();
throw DataAccessException.datastoreError( tab );
}
}
What fixed it: userLoginBean.setUserInfoBean(user);  is what makes it work
What broke it: userLoginBean.setUserID(user.getUserID()) fails! it wants
the whole user bean after insert.  (Dunno why, perhaps someone can explain)
Descriptors:






















What was wrong: nothing
What you don't need to do: access anonymous, or have an auto increment
key in both tables, not needed.  Only in one to get the id you want to
insert in the first place.
Struts specific action simply sets the info in both beans and passes
them down.
I would not mind writing a tutorial on how to do this with both ODMG and
PersistenceBroker.  They're both almost the same.
Hope this helps someone else some day.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uqzZ+cV9vuB27SARAgnTAJ9BlPPfCJNW6CFXjhHrIUGnik4+DgCdHGNk
ra2qpV5HzwZ5iHqsg13cCXg=
=FO/M
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Druid Working, More Info on How To

2003-11-18 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Antonio the class suffix adds an _ before the name of it.  So you end up
with a bean name with _Bean if your suffix is Bean.  That's bad.  I feel
there should be NO _ in the bean names.
Thanks
R
Antonio Gallardo wrote:

| Jewett, Diane C dijo:
|
|>On the Apache OJB tab, What is package and class?
|
|
| "Package" means the package of the generated classes and
|
| "Class Suffix" is an optional suffix to be attached to every generated
| classes.
|
| Best Regards,
|
| Antonio Gallardo
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/up4j+cV9vuB27SARAgKnAKDsiVJS/fKyaivFyK5SBMDISXILDgCfUeB+
t2n+pyxrObaUAMOTHU1WPF4=
=uAYm
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Someone PLEASE help with double insert issue

2003-11-18 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Armin Waibel wrote:

| Hi again,
|
| Robert S. Sfeir wrote:
|
| Thanks for the notes, I am not entirely sure what the info_id is.  Can
| you explain?  How is that any different from the userID I use as a
| foreign key?
|
|> you define a 1:1 reference from UserLoginBean to UserInfoBean, thus
|> you need a FK to UserInfoBean. If you only set 'userId' then the
|> reference-descriptor assume userId field-descriptor of UserLoginBean
|> is the FK to UserInfoBean !?
|> Thus you need an additional FLD.
In my table user_info.user_id is a foreign key reference to
user_login.user_id.
Anyway, I took your suggestion, read the page, and implemented the
changes and the error is the same in the end.
This is the exception, however when I print userID from the
UserInfoBean.getUserID() I get "User ID IS: 10345".  The user id is in
fact NOT null, but the insert says it is.
[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the insert (for a
com.codepuccino.security.beans.UserLoginBean): General error,  message
from server: "Column 'user_id' cannot be null"
General error,  message from server: "Column 'user_id' cannot be null"
java.sql.SQLException: General error,  message from server: "Column
'user_id' cannot be null"
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1750)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1596)
at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown
Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
at
com.codepuccino.security.sql.ojb.RegistrationDAOImpl.addRegistration(RegistrationDAOImpl.java:158)
at
com.codepuccino.security.actions.RegistrationAction.execute(RegistrationAction.java:109)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:209)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at
org.apache.coyote.http

Re: Someone PLEASE help with double insert issue

2003-11-18 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Thanks for the notes, I am not entirely sure what the info_id is.  Can
you explain?  How is that any different from the userID I use as a
foreign key?
Also the extra field ids, and proxy stuff came from the Druid app, and I
didn't get a chance to clean that up.
Is the info_id going to solve my multiple insert issue?

R

Armin Waibel wrote:

| Hi Robert,
|
| I'm not an expert on this subject,
| anyhow some notes to your posted repository
| (maybe someone can correct me):
|
| - attribute 'id' not necessary in class-descriptor
| - attribute 'id' not necessary in field-descriptor
| - attribute 'field-id-ref' is not necessary when attribute
| 'field-ref' is set too.
|
| 
|
| 
|
| 
|
| 
|
| 
|
| 
|
| 
|
| 
|
| 
|
| 
|  
| 
| 
|
|
| ###
| I replaced
| 
| by
| 
|
| and add a new field-descriptor 'infoId', because you need a
| field-descriptor with a fk to UserInfoBean
|
| If you don't want to declare a infoId field in your UserLoginBean
| class, declare field to be 'anonymous':
|
| 
|
| More info see
| http://db.apache.org/ojb/howto-use-anonymous-keys.html
|
|
|
| 
|
| 
|
| 
|
| 
|
| 
|
| 
|
| 
| 
| 
|
| 
|
| You declare both classes as dynamic proxy, but in your
| code you still use real class arguments
|
| public final void addRegistration( final UserInfoBean user, final
| UserLoginBean userLoginBean )
|
| it's ok in that case, but don't forget to operate on
| the interfaces when use dynamic proxies.
|
| regards,
| Armin
|
|
| Robert S. Sfeir wrote:
|
| I am still trying to insert 2 beans into 2 separate tables, however bean
| 2 needs the userID from bean 1's insert.
|
| I can't seem to find examples for this, and everything I try inserts the
| first bean, seems to get the id after insert, I do a setUserID on the
| second bean, then perform the insert, and I still get an exception that
| user_id cannot be null.  It's NOT NULL!  I am pretty frustrated with
| this.  It should be simple, it's not.  I've tried it with ODMG and with
| PersistenceBroker, both return the same problem.
|
| Further the first insert gets commited even though the transaction
| commit is not called, and therefore I can't rollback any changes once
| the second insert fails.
|
| I'm using RC4.
|
| Here is what my insert looks like:
|
| public final void addRegistration( final UserInfoBean user, final
| UserLoginBean userLoginBean )
| throws DataAccessException
| {
| final PersistenceBroker broker =
| PersistenceBrokerFactory.defaultPersistenceBroker();
| try
| {
| LOGGER.log( Level.FINEST, "Transaction open in " +
| RegistrationDAOImpl.class.getName() );
|
| broker.beginTransaction();
| broker.store( user );
| userLoginBean.setUserID( user.getUserID() );
| broker.store( userLoginBean );
| broker.commitTransaction();
| }
| catch( PersistenceBrokerException tab )
| {
| broker.abortTransaction();
| throw DataAccessException.datastoreError( tab );
| }
| }
|
| XML:
|
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
|
| PLEASE what am I missing?  I'm going gaga here because I don't see the
| problem.
|
| R
|>
|>
- -
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uiLP+cV9vuB27SARAnTtAJwOWq6uMxSYHT/mCMA1WLC6OI7cWgCgq71y
F18DWvmn4KXdkApzWe2ZVgA=
=QFlq
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Someone PLEASE help with double insert issue

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I am still trying to insert 2 beans into 2 separate tables, however bean
2 needs the userID from bean 1's insert.
I can't seem to find examples for this, and everything I try inserts the
first bean, seems to get the id after insert, I do a setUserID on the
second bean, then perform the insert, and I still get an exception that
user_id cannot be null.  It's NOT NULL!  I am pretty frustrated with
this.  It should be simple, it's not.  I've tried it with ODMG and with
PersistenceBroker, both return the same problem.
Further the first insert gets commited even though the transaction
commit is not called, and therefore I can't rollback any changes once
the second insert fails.
I'm using RC4.

Here is what my insert looks like:

public final void addRegistration( final UserInfoBean user, final
UserLoginBean userLoginBean )
throws DataAccessException
{
final PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
try
{
LOGGER.log( Level.FINEST, "Transaction open in " +
RegistrationDAOImpl.class.getName() );
broker.beginTransaction();
broker.store( user );
userLoginBean.setUserID( user.getUserID() );
broker.store( userLoginBean );
broker.commitTransaction();
}
catch( PersistenceBrokerException tab )
{
broker.abortTransaction();
throw DataAccessException.datastoreError( tab );
}
}
XML:























PLEASE what am I missing?  I'm going gaga here because I don't see the
problem.
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uaZF+cV9vuB27SARAujIAJ9m8nJpgW5xVdN3OPb6ef9BlYSeHwCeMDUf
ob+buyLnTASop68nj+D8Tyg=
=mu+W
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Which database to use - PostgreSQL or MySQL?

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Yeah it's a real toss up between the two.  I find that the
implementation of InnoDB or BerkeleyDB is real klugy in MySQL, but
Postgres provides you with Industrial Strength, excellent uptime, and
generally good performance DB.  It's not as fast as MySQL, I don't think
may DBs are actually.
Adding to this Postgresql simply doesn't have a solid native Windows
build, so if you're looking to run on windows, forget it.  MySQL seems
to run on just about anything under the Sun.
There are however excellent tools to manage both if you look at third
party apps for your platform... One of them being Druid... weird enough :-)
R

Jason Pyeron wrote:
| MySQL is designed to be efficient at the sake of loss of ANSI 92
| comliance.
|
| PostGreSQL is a great DATABASE but thats about it, poor admin, not that
| fast when it really matters.
|
|
|
| On Mon, 17 Nov 2003, Robert J Celestino wrote:
|
|
|>As far as ease of use with ojb, all are equal.
|>
|>So the following is just about preference, but take this with a grain
of salt since I am, by no means, a database "expert" (could that be why
I am using OJB? :-) ).
|>
|>I have used both postgresql and mysql on real production products. The
impression I get from most DB types, is that mysql is a "toy database"
and postgress is more "industrial strength". This may have been true 5
years ago, but I don't think that is true anymore.
|>
|>I find that mysql has nicer tools.
|>
|>Given my experience I would vote for mysql. I find it up to any task I
throw at it.
|>
|>
|>Bob Celestino
|>SAS Research and Development
|>919 - 531 - 9425
|>[EMAIL PROTECTED]
|>
|>SAS - The Power to Know
|>
|>
|>  > -Original Message-
|>  > From: Jewett, Diane C [mailto:[EMAIL PROTECTED]
|>  > Sent: Monday, November 17, 2003 3:35 PM
|>  > To: OJB Users List
|>  > Subject: Which database to use - PostgreSQL or MySQL?
|>  >
|>  >
|>  > What is the best and most reliable open-source database to use?
|>  >
|>  > Is one easier to use with OJB?
|>  >
|>  > 
|>  > -
|>  > 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]
|>
|
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uUeC+cV9vuB27SARAgevAJ4ut9E5jrkz2KlrVRY3xoqbmkzUaQCdHF8R
CojCUSv2DPK+d9DMkR8y1b4=
=ARkv
-END PGP SIGNATURE-


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


Re: Which database to use - PostgreSQL or MySQL?

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
That's the beauty of OJB, it doesn't care who's on the other end.  I've
used the same schema on Postgresql, MySQL, Oracle and MSSQL with OJB
with no issues.
It's art work I tell ya... art work.

R

Jewett, Diane C wrote:

| What is the best and most reliable open-source database to use?
|
| Is one easier to use with OJB?
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uTHs+cV9vuB27SARAgB/AJ9PYMeHiyjDOtZntePANAXHK8B7wQCgi2sQ
i0DBGdbA9Wh4fH34adffrFc=
=3UW4
-END PGP SIGNATURE-


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


Re: About Druid.

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
yes appologies for me posting here, I was hoping others would know some
about it since they've used it to generate repository.xml.
R

Antonio Gallardo wrote:

| Hi:
|
| I am happy of the growing interest in using Druid to generate the
| repository.xml. :-D
|
| But I have concerns about the "Druid invasion" in the OJB list. And I hope
| OJB committers are not angry for this.
|
| Druid has also his own maillists:
|
| http://sourceforge.net/mail/?group_id=15111
|
| But if all is OK. I can continue the this interesting dicussions here. I
| comment this for respect to OJB people that does not use Druid at all.
|
| Best Regards,
|
| Antonio Gallardo.
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uSyy+cV9vuB27SARAlgnAKD8D2Ud+ArlmOGftacGT1md/9s5AQCg8vNh
G7dJA1lAQOV1iItEp0fLeMo=
=borp
-END PGP SIGNATURE-


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


Re: Druid Working, More Info on How To

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Antonio!  you're on list!  I saw your name in the docs.  Nice work.

Look I have to ask you for something.  When generating bean names based
on table names, can we not have the _ from the table names in the bean
names and consider every _ a new word?
So if we have

cdpcno_user_info for the table name

we should have CdpcnoUserInfo for the bean Name.  This way I can throw
Bean at the end of it, and voila CdpcnoUserInfoBean is the name and I
don't have to constantly maintain the OJB script.
It would also be good to specify multiple packages, perhaps specify a
package per table and not per Apache OJB Generator.  Some table beans
don't all belong under the same package.  So it would be helpful.
Perhaps this is not the place for these feature requests.
Good work.

R

Antonio Gallardo wrote:

| Robert S. Sfeir dijo:
|
|>-BEGIN PGP SIGNED MESSAGE-
|>Hash: SHA1
|>
|>WOW!  Foreign-Keys are as ass backwards as can be in Druid.  Sorry if
|>the author is on here... but geez, relating foreign keys requires you to
|>click on a COLUMN TYPE and then scroll down to see it!  makes no sense
|>if you ask me... but hey what ever works.
|
|
| Hi:
|
| I am jus a druid committer, I wrote the OJB and Java generator. We are
| aware there are still some type of situations when the generator does not
| works fine and the foreign key management inside druid is not the good
| one. We are trying to solve it in the next release.
|
| Also, please understand the OJB and Java generator are just 1 month olds.
| And I am totally newbie in OJB (2 or 3 months), so I studied the
| repository.xml, asked on the list some questions and build it. I thougt it
| will be improved with the time as we figured out how it would work better.
| It is part of my own interest to do that.
|
| But, right now I am totally busy with a project and we need to end by the
| end of the year.
|
| Anyway, I wrote this because I hate to write manually repository.xml and
| Beans by hand. I think it is a very boring work. :-D
|
| Thanks for your comments.
|
| Best Regards,
|
| Antonio Gallardo
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uSl2+cV9vuB27SARAur5AJ0ZYnOfTaOFfsKCWnYclI5vapNp3QCg+VzA
+VwDxpFEg94Up/GujUNzJk0=
=Vt/+
-END PGP SIGNATURE-


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


Re: Druid Working, More Info on How To

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


Jason Pyeron wrote:

| BEAT DRUID WITH STICK or atleast with section 1.6 of the tutorial.

haha yeah I was looking at that, and it STILL wasn't obvious...  you
gotta beat ME up with sticks I guess... lol
| now on to code generation
|
|
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uSiw+cV9vuB27SARAntPAJ0bBDPtw+Ey4KRGPfrg9cQfVQpH7gCglIhr
E3I14VGS6E/tfR5svIl1mak=
=JAwq
-END PGP SIGNATURE-


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


Re: Druid Working, More Info on How To

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
WOW!  Foreign-Keys are as ass backwards as can be in Druid.  Sorry if
the author is on here... but geez, relating foreign keys requires you to
click on a COLUMN TYPE and then scroll down to see it!  makes no sense
if you ask me... but hey what ever works.
Now I've got all the pieces of druid figured out.

As to the generation of OJB WHOM ever wrote this module... YOU KICK ASS!












This is what it generated for me.  Ok I don't like the bean names, but
that's just changing the names of my tables to match the bean name... so
what?  Minimal.
R

Robert S. Sfeir wrote:

| I've figured out how to import existing tables if anyone is interested.
|
| Setup your jdbc driver
| Create a new project
| Right click and create a new Database.  I created an empty one
| Switch to the jdbc tab on the right
| Choose the appropriate URL for your DB and fill in the info
| Type in Username and password and click connect at the bottom
| After you're connected switch to the Structure tab
| Right click on Jdbc Database icon
| Choose Import Entities
|
| Check everything
|
| Import
|
| Done
|
| And just figured out how to generate the FULL schema using Druid... VERY
| VERY VERY SWEET!
|
| To do that:
| 1- Click on the DB icon
| 2- Choose Generation
| 3- Right Click Generic
| 4- Add Module
| 5- Choose Apache OJB
| 6- Fill in the information in both tabs
| 7- Right click the Apache OJB icon and choose generate...
|
| DONE!
|
- -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uSAh+cV9vuB27SARAs1KAKDzz9AwugijcGNQA1T5TSO3V9mlDACffxMr
aDF2v6vfRxSzUA7zWZRrEuI=
=o34O
-END PGP SIGNATURE-


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


Re: [OT] Druid Working, More Info on How To

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Nope that didn't do it.  Still can't see foreign-keys although I do have
one setup.  Trying to do this with MySQL 4.0.15, and  JDBC driver 3.0.9
Any clues to that would be wonderful.

R

Robert S. Sfeir wrote:

| AHA!  I was hoping someone would clear that up.  I was looking for that,
| and it was the most important part of the whole enchilada :-)  Will give
| it a try.
|
| I hope the ultra-mini-howto helped others.
|
| R
|
| Charles Anthony wrote:
|
| |>From: Jason Pyeron [mailto:[EMAIL PROTECTED]
| |>
| |>On Mon, 17 Nov 2003, Robert S. Sfeir wrote:
| |>
| |>
| |>>I've figured out how to import existing tables if anyone is
| |>
| |>interested.
| |>
| |>>Setup your jdbc driver
| |>
| |>...
| |>
| |>>Choose Import Entities
| |>>
| |>>Check everything
| |>
| |>where are the foreign keys
| |
| | [...]
| |
| |>I am an OJB user, I use MySQL4 and I have been doing things
| |
| |   ^^
| | Which version of the MySQL jdbc driver (JConnect ??) are you using ?
| |
| | According to http://www.mysql.com/downloads/api-jdbc-stable.html the
| latest
| | release, 3.09 fixes some bugs to do with foreign key metadata on InnoDB
| | tables.
| | More info on one of the bugs here :
| | http://bugs.mysql.com/bug.php?id=517
| |
| | I suspect that Druid uses the foreign key metadata stuff in the driver
| to do
| | it's thang. If it ain't reported from MySql, Druid can't use it.
| |
| | HTH,
| |
| | Cheers,
| |
| | Charles.
| |
| |
| | ___
| | HPD Software Ltd. - Helping Business Finance Business
| | Email terms and conditions: www.hpdsoftware.com/disclaimer
| |
| |
| |
| | -
| | 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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uQJA+cV9vuB27SARAgx+AJ4uRTKZLrWCPUEOmXd/esXeWbYwqACffdIN
Ek57rLdyiIBA/AbzK8ocGwg=
=vjfS
-END PGP SIGNATURE-


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


Re: Druid, was: Re: Reposit

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Oh yeah and if you want to work with the tables you have to drag them
out of the created import folder into your database icon, otherwise you
won't get the right menu choices and stuff like that.
By the way, I still don't see how Druid can generate OJB repository files.

R

Jakob Braeuchi wrote:

| hi antonio,
|
| how can i import existing tables ?
|
| jakob
|
| Antonio Gallardo wrote:
|
|> Brian McCallister dijo:
|>
|>> Druid is really cool, but I have never actually gotten the code
|>> generation to work. When I hook it to an existing DB, import the
|>> entities and go to code generation and I get an error saying datatypes
|>> are set on all of my foreign keys =/
|>
|>
|>
|> Hi Brian:
|>
|> You need to define "DD equiv." field for your datatypes at the database
|> level:
|>
|> Select the database.
|> Select the "Data Types" tab.
|> For every datatype define the datatype you want to use in Java. Example:
|> Druid Type --> DD equiv.
|> bit--> Boolean
|> Varchar--> String,
|>
|> etc.
|>
|> Then try again.
|>
|> BTW, try better the CVS version, because the official release had some
|> bug
|> in OJB generation.
|>
|> Best Regards,
|>
|> Antonio Gallardo.
|>
|>> -Brian
|>>
|>> On Wednesday, November 12, 2003, at 05:19 PM, Antonio Gallardo wrote:
|>>
|>>
|>>> Gus Heck dijo:
|>>>
| This is probably a terribly noob question, but is there a good way to
| generate my object mappings for the repository.xml? Seems like a lot
| of
| tedium to do it for more than one or two classes.
|>>>
|>>>
|>>> Hi Gus:
|>>>
|>>> Druid - http:// druid.sf.net/ - Please, download it from the CVS.
|>>>
|>>> Best Regards,
|>>>
|>>> Antonio Gallardo
|>>>
|>>>
|>>> -
|>>> 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]
|>
|>
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uOcd+cV9vuB27SARAkRVAJ4omNLmjqIk7JGbcDe2GZrvLpejdwCgodAR
7BGP2HNDuiBmMk3GErjMPk0=
=s27k
-END PGP SIGNATURE-


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


Re: Druid, was: Re: Reposit

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
And just figured out how to generate the FULL schema using Druid... VERY
VERY VERY SWEET!
To do that:
1- Click on the DB icon
2- Choose Generation
3- Right Click Generic
4- Add Module
5- Choose Apache OJB
6- Fill in the information in both tabs
7- Right click the Apache OJB icon and choose generate...
DONE!

R

Jakob Braeuchi wrote:

| hi antonio,
|
| how can i import existing tables ?
|
| jakob
|
| Antonio Gallardo wrote:
|
|> Brian McCallister dijo:
|>
|>> Druid is really cool, but I have never actually gotten the code
|>> generation to work. When I hook it to an existing DB, import the
|>> entities and go to code generation and I get an error saying datatypes
|>> are set on all of my foreign keys =/
|>
|>
|>
|> Hi Brian:
|>
|> You need to define "DD equiv." field for your datatypes at the database
|> level:
|>
|> Select the database.
|> Select the "Data Types" tab.
|> For every datatype define the datatype you want to use in Java. Example:
|> Druid Type --> DD equiv.
|> bit--> Boolean
|> Varchar--> String,
|>
|> etc.
|>
|> Then try again.
|>
|> BTW, try better the CVS version, because the official release had some
|> bug
|> in OJB generation.
|>
|> Best Regards,
|>
|> Antonio Gallardo.
|>
|>> -Brian
|>>
|>> On Wednesday, November 12, 2003, at 05:19 PM, Antonio Gallardo wrote:
|>>
|>>
|>>> Gus Heck dijo:
|>>>
| This is probably a terribly noob question, but is there a good way to
| generate my object mappings for the repository.xml? Seems like a lot
| of
| tedium to do it for more than one or two classes.
|>>>
|>>>
|>>> Hi Gus:
|>>>
|>>> Druid - http:// druid.sf.net/ - Please, download it from the CVS.
|>>>
|>>> Best Regards,
|>>>
|>>> Antonio Gallardo
|>>>
|>>>
|>>> -
|>>> 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]
|>
|>
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uOsa+cV9vuB27SARAmnYAJ9lfNtW+Q+YOc/dDlNB6sg1WpQJjACglK/u
zWxqgAr7B/OdPDvc+e9Y7tE=
=iNaB
-END PGP SIGNATURE-


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


Re: Druid, was: Re: Reposit

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I've figured out how to import existing tables if anyone is interested.

Setup your jdbc driver
Create a new project
Right click and create a new Database.  I created an empty one
Switch to the jdbc tab on the right
Choose the appropriate URL for your DB and fill in the info
Type in Username and password and click connect at the bottom
After you're connected switch to the Structure tab
Right click on Jdbc Database icon
Choose Import Entities
Check everything

Import

Done

R
Jakob Braeuchi wrote:
| hi antonio,
|
| how can i import existing tables ?
|
| jakob
|
| Antonio Gallardo wrote:
|
|> Brian McCallister dijo:
|>
|>> Druid is really cool, but I have never actually gotten the code
|>> generation to work. When I hook it to an existing DB, import the
|>> entities and go to code generation and I get an error saying datatypes
|>> are set on all of my foreign keys =/
|>
|>
|>
|> Hi Brian:
|>
|> You need to define "DD equiv." field for your datatypes at the database
|> level:
|>
|> Select the database.
|> Select the "Data Types" tab.
|> For every datatype define the datatype you want to use in Java. Example:
|> Druid Type --> DD equiv.
|> bit--> Boolean
|> Varchar--> String,
|>
|> etc.
|>
|> Then try again.
|>
|> BTW, try better the CVS version, because the official release had some
|> bug
|> in OJB generation.
|>
|> Best Regards,
|>
|> Antonio Gallardo.
|>
|>> -Brian
|>>
|>> On Wednesday, November 12, 2003, at 05:19 PM, Antonio Gallardo wrote:
|>>
|>>
|>>> Gus Heck dijo:
|>>>
| This is probably a terribly noob question, but is there a good way to
| generate my object mappings for the repository.xml? Seems like a lot
| of
| tedium to do it for more than one or two classes.
|>>>
|>>>
|>>> Hi Gus:
|>>>
|>>> Druid - http:// druid.sf.net/ - Please, download it from the CVS.
|>>>
|>>> Best Regards,
|>>>
|>>> Antonio Gallardo
|>>>
|>>>
|>>> -
|>>> 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]
|>
|>
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uOaU+cV9vuB27SARAvFZAJ9O5ZK41NGku94fXEnx7xxJ+CePPQCg+f3f
l3ffuBhMB+ibWEIuYIxKZ6U=
=QjIb
-END PGP SIGNATURE-


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


Re: Druid Working, More Info on How To

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
AHA!  I was hoping someone would clear that up.  I was looking for that,
and it was the most important part of the whole enchilada :-)  Will give
it a try.
I hope the ultra-mini-howto helped others.

R

Charles Anthony wrote:

|>From: Jason Pyeron [mailto:[EMAIL PROTECTED]
|>
|>On Mon, 17 Nov 2003, Robert S. Sfeir wrote:
|>
|>
|>>I've figured out how to import existing tables if anyone is
|>
|>interested.
|>
|>>Setup your jdbc driver
|>
|>...
|>
|>>Choose Import Entities
|>>
|>>Check everything
|>
|>where are the foreign keys
|
| [...]
|
|>I am an OJB user, I use MySQL4 and I have been doing things
|
|   ^^
| Which version of the MySQL jdbc driver (JConnect ??) are you using ?
|
| According to http://www.mysql.com/downloads/api-jdbc-stable.html the
latest
| release, 3.09 fixes some bugs to do with foreign key metadata on InnoDB
| tables.
| More info on one of the bugs here :
| http://bugs.mysql.com/bug.php?id=517
|
| I suspect that Druid uses the foreign key metadata stuff in the driver
to do
| it's thang. If it ain't reported from MySql, Druid can't use it.
|
| HTH,
|
| Cheers,
|
| Charles.
|
|
| ___
| HPD Software Ltd. - Helping Business Finance Business
| Email terms and conditions: www.hpdsoftware.com/disclaimer
|
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uQDl+cV9vuB27SARAoP9AJ9ARTfxpPqgdfm7/G4iWlo7yrUCqQCgwOXm
7eGNcrn5sC0z8gppq7t2u8E=
=7Y1e
-END PGP SIGNATURE-


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


Druid Working, More Info on How To

2003-11-17 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I've figured out how to import existing tables if anyone is interested.

Setup your jdbc driver
Create a new project
Right click and create a new Database.  I created an empty one
Switch to the jdbc tab on the right
Choose the appropriate URL for your DB and fill in the info
Type in Username and password and click connect at the bottom
After you're connected switch to the Structure tab
Right click on Jdbc Database icon
Choose Import Entities
Check everything

Import

Done

And just figured out how to generate the FULL schema using Druid... VERY
VERY VERY SWEET!
To do that:
1- Click on the DB icon
2- Choose Generation
3- Right Click Generic
4- Add Module
5- Choose Apache OJB
6- Fill in the information in both tabs
7- Right click the Apache OJB icon and choose generate...
DONE!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/uPvZ+cV9vuB27SARAhzLAKDyJTvwRUScB9oVQ5b9xq6XwKrvfgCfarRn
PRj46vl275/fbSiVjJ7rJaA=
=ZzIJ
-END PGP SIGNATURE-


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


Still issues with multi table insert

2003-11-16 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ok can't figure this out, and searching is leading me nowhere so far.
Sorry if this seems basic, it doesn't seem like it, but it should be.
I've got 2 class descriptor blocks like these:



















I am trying to insert data into both tables in one submit, and I'm
miserably failing at:
1- Getting the UserLoginBean's userID to set based on the insert from
UserInfoBean.
2- If the first insert to user info works, and the second fails, it
seems to not rollback the first insert.  So what I need is a way to not
commit the transaction until the whole enchilada is done.
Some things I have:
1- UserLoginBean has variables and get/set methods for UserInfoBean
2- UserInfoBean has a Collection of userLoginColl
My struts action passes userLoginBean and userInfoBean objects to my OJB
impl class called RegistrationDAOImpl.
In RegistrationDAOImpl I do this:
public final void addRegistration( final UserInfoBean user, final
UserLoginBean userLoginBean )
throws DataAccessException
{
final Transaction tx = getOdmgImpl().newTransaction();
try
{
LOGGER.log( Level.FINEST, "Transaction open in " +
RegistrationDAOImpl.class.getName() );
tx.begin();
tx.lock( user, Transaction.WRITE );
userLoginBean.setUserID( user.getUserID() );
tx.lock( userLoginBean, Transaction.WRITE );
tx.commit();
}
catch( TransactionAbortedExceptionOJB tab )
{
throw DataAccessException.datastoreError( tab );
}
}
The exception is that the primary key is null in UserLoginBean.

What's the right way to do this???

Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD4DBQE/uFmP+cV9vuB27SARAvccAJdsQ8aJDfcGYlByfgT3utuBSukQAJ0TnnkC
cBPSSQOs1ZRvDQtjHO6Tkw==
=4Q26
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: OJB NPE On Double Table Insert

2003-11-14 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I seem to have resolved it.  I had a foreign key specified in both the
user_info and user_login descriptors and the user_login descriptor
busted the insert.  Removing the foreign key worked, I'm going to use an
inverse foreign key.
R

Robert S. Sfeir wrote:
| Folks,
|
| I'm trying to do an double insert in 2 tables and for some reason I'm
| getting a NullPointerException.  The way I go about it is below:
|
| //Open transaction
| tx = getOdmgImpl().newTransaction();
|
| //Transaction begins
| tx.begin();
| //Do first Insert
| tx.lock( user, Transaction.WRITE );
| //Get User ID after insert and set it in the second Bean
| userLoginBean.setUserID( user.getUserID() );
| //Do second insert
| tx.lock( userLoginBean, Transaction.WRITE );
| //commit
| tx.commit();
|
| The problem, from my debugging investigation, is that OJB seems to think
| that userID is empty, it's not, because as I was stepping through the
| debugger, I could see that userLoginBean.getUserID() returned a correct
| value, the one from the first insert.
|
| I do have a catch clause so that if an exception is thrown it will do
| tx.abort() but it seems that if I don't catch some exception, like one I
| haven't accounted for yet, and an exception gets thrown, then the first
| insert is commited anyway... Is this correct behavior?
|
| Is this the right way of doing a double table insert?
|
| Thanks
| R
- -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/tYRf+cV9vuB27SARAtZxAJ9kQrsU+2J6P8VX3CXGLz5fbK9d/gCdGxDG
NyDbLlFLGMkap+Kt8+HQf6Q=
=5QJo
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: OJB NPE On Double Table Insert

2003-11-14 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Nope, doesn't work, just inserts data in user_login table and nothing else.

R

Robert J Celestino wrote:

| Hello Robert,
|
| Would it work to simply let userLoginBean reference User in the
repository_user.xml? Then you would simply store the bean, and ojb would
do the rest. Example:
|
|   
|   
|   
|
|   
|   
|   
|
|
|
|   
|
|
|
| 
| Bob Celestino
| SAS Research and Development
| 919 - 531 - 9425
| [EMAIL PROTECTED]
|
| SAS - The Power to Know
|
|
|   > -Original Message-
|   > From: Robert S. Sfeir [mailto:[EMAIL PROTECTED]
|   > Sent: Friday, November 14, 2003 7:34 PM
|   > To: OJB Users List
|   > Subject: OJB NPE On Double Table Insert
|   >
|   >
|   >
|   >
|   > 
|   > -
|   > 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]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/tXsE+cV9vuB27SARArfXAJ95yqosnYE7OJatAQOH1tneDkU6dwCfQNM0
c5xfmU5/R6FqhT4q/Ov3iVc=
=rWVh
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


OJB NPE On Double Table Insert

2003-11-14 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Folks,

I'm trying to do an double insert in 2 tables and for some reason I'm
getting a NullPointerException.  The way I go about it is below:
//Open transaction
tx = getOdmgImpl().newTransaction();
//Transaction begins
tx.begin();
//Do first Insert
tx.lock( user, Transaction.WRITE );
//Get User ID after insert and set it in the second Bean
userLoginBean.setUserID( user.getUserID() );
//Do second insert
tx.lock( userLoginBean, Transaction.WRITE );
//commit
tx.commit();
The problem, from my debugging investigation, is that OJB seems to think
that userID is empty, it's not, because as I was stepping through the
debugger, I could see that userLoginBean.getUserID() returned a correct
value, the one from the first insert.
I do have a catch clause so that if an exception is thrown it will do
tx.abort() but it seems that if I don't catch some exception, like one I
haven't accounted for yet, and an exception gets thrown, then the first
insert is commited anyway... Is this correct behavior?
Is this the right way of doing a double table insert?

Thanks
R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/tXRp+cV9vuB27SARAhy8AJ42hoS9ip23sLzhLmWbfE+8/obKSQCgrEpl
xzk9G4JUM27njZMwn3iVoUs=
=aiYd
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: what is the reason of LockNotGrantedException

2003-11-14 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I've seen this when I get a mismatched bean with the DB.  It's not
always the case, look at the whole stack, OJB is really good about
giving you reasons why something happened.
R

[EMAIL PROTECTED] wrote:
| Hi
| what is the reason if a LockNotGrantedException is thrown by calling
| tx.lock(myobject,tx.WRITE):
| 1. The locking dos not work (some internal error of ojb, config problem,
| table missing)?
| 2. a object is still locked, so I have to try later to write my object?
|
| regards
| Matthias Roth
|
|
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/tTVQ+cV9vuB27SARAkP9AJ4iFiodE7uQSdVCkC0tu7DHO+sIQACfSGe2
ft8cOTc5BdIzbmnlKEmNgEQ=
=AL5m
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: OJB Still alive?

2003-11-14 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
HAHA, Hi Armin, I in NO WAY meant to inflame anything, it's just that by
the look of the site things haven't moved which is why I figured to jump
on the list again and see what's up... and I can see A LOT!
Thanks, will check out the HEAD and see if I can find anything to help
report bugs etc...
R

Armin Waibel wrote:
| Hi Robert,
|
| welcome back again. Great inflammatory thread title ;-)
|
| OJB is still alive, ojb-community and developer have done much work
| since rc4 (bug fixing, rewriting of tutorial docs, more junit test,
| some improvements,...).
|
| Current CVS head is pretty stable give it
| a try. We are near a new rc, but this should be the
| last before 1.0 - this cause the delay.
|
| regards,
| Armin
|
| Robert S. Sfeir wrote:
|
| Hi, I haven't been on here for a while, and still using OJB, but I
| noticed that the latest is still rc4, and it's been like that for a
| while, and wanted to know if it was still under development, of the
| authors have parked development and I should look into other solutions
| such as EJB etc...
|
| Thanks for any response you can provide.
|
| R
|>
|>
- -
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/tPGO+cV9vuB27SARAl1kAJ92O751VLZSnZGR/N7L0KudtFhPIACdFn5Z
QJWSJV0alHAPRNNoFaFHYGk=
=cqyP
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: OJB Still alive?

2003-11-14 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Brian thanks for your response, I'm glad things are OK because I've been
touting OJB as the best game in town, and I still think it is.
What is OTM?

Where can I get access to a lit of tools for OJB?

Has the reverse DB issue been resolved since I last worked on OJB?  I am
still interested in setting up my DB, setup all foreign keys and
indexes, and have reverse DB pull all that info into a nice clean XML
doc.  Is this working now, or are we still waiting for this to happen?
Really sorry if I;m repeating previously asked questions, I'll do my
best to bring things back up to speed on my end.
R

Brian McCallister wrote:

| Alive and kicking =) From my somewhat biased perspective OJB is only
| picking up more steam recently.
|
| We are about to make the 1.0 CVS branch, the OTM is hot stuff, JDO is in
| active development on top of the OTM, the developer community is
| growing, list traffic is high, additional tool support is appearing
| weekly it seems (go Druid, now that I got it working (thank you
Antonio!)).
|
| -Brian
|
| On Friday, November 14, 2003, at 09:04 AM, Robert S. Sfeir wrote:
|
| Hi, I haven't been on here for a while, and still using OJB, but I
| noticed that the latest is still rc4, and it's been like that for a
| while, and wanted to know if it was still under development, of the
| authors have parked development and I should look into other solutions
| such as EJB etc...
|
| Thanks for any response you can provide.
|
| R
|>
|>
- -
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]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/tOfw+cV9vuB27SARAtLRAKD7wcAPsXjzA/KHdf06kSjbeuhl3QCgrnGL
HfHFB+97BAP9w8AKF43QzWc=
=ZDV+
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


OJB Still alive?

2003-11-14 Thread Robert S. Sfeir
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi, I haven't been on here for a while, and still using OJB, but I
noticed that the latest is still rc4, and it's been like that for a
while, and wanted to know if it was still under development, of the
authors have parked development and I should look into other solutions
such as EJB etc...
Thanks for any response you can provide.

R
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE/tODj+cV9vuB27SARAvy6AKCsmcnWAONXYA8OQFnq2Fs8HDgTYQCg9W/V
ur8CHCkA7WdTeFo0inem8oY=
=j7NB
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: ODMG Query over objects always returns a Collection (DList)?

2003-03-24 Thread Robert S. Sfeir
I should add that a DList or Collection of some type is returned is 
actually a good thing.  Why?  Take a scenario where you have a User 
object and we're returning a User object from OJB.  You use that object 
all over your code.  One day you decide to change the User object and 
call is People.  You code will be broken from top to bottom because it 
either won't find your object or you'll get ClassCastException s.  If 
we always return a Collection then you always deal with a Collection 
and what is inside it is irrelevant until you get to the point in your 
code where you need to retrieve that object.  In my case that doesn't 
happen until I get to the Presentation layer of my application which 
means I would effectively only break one spot if I changed anything, 
and that spot is predictable.

Just my 2c

On Monday, March 24, 2003, at 07:11 AM, Robert S. Sfeir wrote:

The Collection (DList which is changeable from the OJB.properties) 
DOES contain a User object.

On Friday, March 21, 2003, at 12:38 PM, Edson Carlos Ericksson Richter 
wrote:

Hi!

Table:
  UsersTable (id, username, password) -> mapped to User object with 
same
properties.
where id is Primary Key, and username is a unique key.

Well, if I query "select user from User where username = $1 and 
password =
$2", ODMG will always return a collection when I issue 
query.execute()? Or
it should detect that has only one object, and return a User object?

Just get from API doc for OQLQuery:
"The object that represents the result of the query. The returned 
data,
whatever its OQL type, is encapsulated into an object. For instance, 
when
OQL returns an integer, the result is put into an Integer object. 
When OQL
returns a collection (literal or object), the result is always a Java
collection object of the same kind (for instance, a DList). "

Appear to me that when OQL returns an User, the result should be put 
into
User object, as in "For instance, when OQL returns an integer, the 
result is
put into an Integer object".

Thanks for any clarification.

Edson Richter



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 17/3/2003



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


  1   2   >