Re: My object disappear when I restart ozone.
"Leo Mekenkamp" <[email protected]>
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Message-ID | <[email protected]> |
> I try 1.2rc already. It's still disappear for local.
I took the simple example in the samples directory of 1.2-rc2, and rewrote
it a bit:
public class LocalClient {
public static void main(String[] args) throws Exception {
LocalDatabase db = new LocalDatabase();
String dbLocation = System.getProperty("user.home") + "/testdb";
if (!db.exists(dbLocation)) {
db.create(dbLocation);
}
db.open(dbLocation);
Bus bus = (Bus) db.objectForName("bus");
if (bus == null) {
System.out.println("creating!");
bus = (Bus) db.createObject(BusImpl.class.getName(), 0, "bus");
}
System.out.println("bus:" + bus);
db.close();
}
}
The first time I run it (dir "/testdb" does not exist prior to first run)
there is a "creating!" msg; bus handle is 104. The second time I run it
there is no "creating!" msg, and the bus is correctly retrieved from the
db (handle still 104).
Stopping the db and opening it again in the same run also gave no
unexpected results.
From this I can only conclude that LocalDatabase does not exhibit the
"lost first object" bug, and the fault must be sought somewhere else.
Cheers,
Leo
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click