[jboss-user] [JBoss Seam] - PostgreSQL collection problem

Joost Kraaijeveld J.Kraaijeveld at Askesis.nl
Fri Dec 8 03:04:16 EST 2006


On Fri, 2006-12-08 at 02:46 -0500, sherkan777 wrote:
> Hi all,
> Sorry for off topic, but those forum is most often searched:P
> 
> My problem is with PostgreSQL db, previous I've used MySQL and everythink worked fine, but when I migrated to Postgre somethink wrong is going on with my collection.
> 
> Let's see.
> Mother has childrens relation 1->n
> List myChildrens = new LinkedList();
> 
> when i load mother object from db i have childrens positioned like I inserted them to db. (that is in mysql).
> example:
> Tom, Mike, Ann.
> 
> After migration to postgresql, every time childrens are loaded different like in set collection.
> 
> Example:
> 1. Tom, Mike, Ann
> 2. Mike, Ann, Tom etc.
> 
> Anyone have an idea what should i check or what mechanism is responsible for loading objects from db?
> 
> By the way mother object is loaded by Find method NOT query. (order by)
> Or maybe i made somethink wrong in my ds xml file with connection properties.

Nothing wrong with this: unless you specify an order in an SQL query, a
database is allowed to return the result set in any order it likes. It
is not even required to return the same result set in the same order if
the query is rerun immediately after the first time.


The fact that MySQL returns the records in insertion order is a
"coincidence".

-- 
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
web: www.askesis.nl



More information about the jboss-user mailing list