Re: What gets stored in an object object, and what doesn't?
Leo Mekenkamp <[email protected]>
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Message-ID | <1084770183.3538.5.camel@jupiter> |
On Sat, 2004-05-15 at 16:44, Aidan Slingsby wrote:
> Hello all,
>
> If an ozone object has a Vector, and things are added to it, I've always
> assumed that if they are Ozone objects, they are not stored again in the
> object, but a reference (or pointer) to the object in the database is
> stored instead. If it is not an ozone object (like a String) it would
> get stored. This has always held true, but now I'm getting some strange
> behaviour which has taken me quite a while to find out what's going on.
>
> I have a unnamed ozone class called FeatureImpl. I also have another
> unnamed ozone class called LineImpl. Many instances of both exist in
> the database.
Just nitpicking here: classes can never be named, only instances can.
> Feature has a Vector (actually is isn't, it's an object
> which extends Object and contains a Vector). I have a routine which
> adds LineImpls to this Vector.
> Within the same routine, if I list the last object in the vector of the
> FeatureImpl just after I've added it, the returned object has the same
> remoteID (hashCode) as the the object I just added. All well and good.
> The strange behaviour is here: When I disconnect from the database and
> reconnect, they the FeatureImpl Vector contains LineImpls (well..
> proxies anyway) with a different and higher remoteID/hashCode - yet have
> the same state variables - which means that my overrided equals routine
> (which compares hashcodes) sees them as different. In looks to me like
> the database has duplicates these objects and that this somehow and for
> some reason happened after I read the last element in the Vector just
> after adding is and reading the contents of the Vector after
> disconnection and reconnection. The LineImpl may be stored in the
> Vector of FeatureImpl (hence my opening paragraph), but actually I think
> this isn't the case because it has a new remoteID
>
> I'm using Ozone 1.2 and LocalDatabase. This definitely worked before,
> but I can't be sure if it's to do with my changing from Ozone 1.1 and
> ExternalDatabase to Ozone 1.2 and LocalDatabase. (I changed to the
> latter because it's easier to debug in a LocalDatabase).
>From my POV it is easier to debug a remote database; if you start
Server.main() from a debugging environment, you can have isolation on
all server side code without client side code getting 'in the way'.
> Is anyone able to offer advice on my problem?
It sounds a bit strange. Can you condense the problem, so that it is
reproducable with a minimum number of line of source code?
Cheers,
Leo
--
.--. .---------------.----------------------------------------.
|o_o | | Leo Mekenkamp | Free, as in 'beer' and as in 'speech': |
|:_/ | | +31 641234919 | office software http://openoffice.org |
// \ \ | | 100% java odbms http://ozone-db.org |
(| | ) | Long Live Tux | e-mail & browser http://mozilla.org |
/'\_ _/`\ | | operating system http://linux.org |
\___)=(___/ `---------------'----------------------------------------'
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click