db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

DB4O on PDA IBM J9 - no data

Last post 06-08-2006, 03:31 PM by moamoa. 6 replies.
Sort Posts: Previous Next
  •  05-23-2006, 03:46 PM 25150

    DB4O on PDA IBM J9 - no data

    I'm busy building a Java application using DB4O community edition and SWT on a PDA using J2SE 1.3 (IBM J9). The idea is to develop and test on Eclipse and then run it on a PDA using IBM J9. This works; that is, the SWT screens come up, I can use DB4O to create a DB with test data and fetch it back on the screns.

    What doesn't work is that if I do NOT create a new database with test data, but try to access a previously stored one, I get no data on the PDA. I do get data running exactly the same code in Eclipse...

     

  •  05-23-2006, 04:24 PM 25151 in reply to 25150

    Re: DB4O on PDA IBM J9 - no data

    Hi,

    this is very likely to be a CLASSPATH or ClassLoader issue.

    Make sure that the db4o.jar is accessed in the same way on the PDA as your application classes.

    You may want to try the following to get db4o to load your persistent classes from a specific ClassLoader:

    ClassLoader cl = SomePersistentClass.class.getClassLoader();
    Db4o.configure().reflectWith(new JdkReflector(cl));

  •  05-24-2006, 11:37 PM 25171 in reply to 25151

    Re: DB4O on PDA IBM J9 - no data

    I am currently using db4o and J9 on a pda just fine.

    I do not put the db4o jar into any ext folder in the J9 folder, but just put it in any folder and add it in the -classpath of the applications shortcut. No specific class loader code seems to be needed, it just runs 100% as is on the desk top.

    I am using the db4o-5.2-java1.2.jar. and the J9 that is part of websphere everywhere 6.1

    hope this helps.


  •  05-29-2006, 01:02 PM 25243 in reply to 25151

    Re: DB4O on PDA IBM J9 - no data

    Carl Rosenberger:

    Make sure that the db4o.jar is accessed in the same way on the PDA as your application classes.

     

    I'm coding very "context unaware". For example: the application for now generates a test set if the DB did not exist. So switching from a fresh testset to a stored one involves just commenting out the delete line like below.

    File lFile =

    new File("test.db4o");

    //lFile.delete();

    boolean

    lFileExists = lFile.exists();

    if

    (!lFileExists) createTestSet();

    As said: with the delete uncommented, I have data, with the commented not.

     

  •  05-29-2006, 02:18 PM 25247 in reply to 25171

    Re: DB4O on PDA IBM J9 - no data

    moamoa:
    I am currently using db4o and J9 on a pda just fine.

    I do not put the db4o jar into any ext folder in the J9 folder, but just put it in any folder and add it in the -classpath of the applications shortcut. No specific class loader code seems to be needed, it just runs 100% as is on the desk top.

    I am using the db4o-5.2-java1.2.jar. and the J9 that is part of websphere everywhere 6.1

    hope this helps.


     

    My version is db4o-5.2-java1.2.jar and swt3139.jar for the GUI, J9 appears to be V6.1.0 so I assume it is the same version as you use.

    Deployment is done in jars, including the application, which is the jar that gets started and has the classpath set in the manifest.mf. In fact the whole J9 including the application is copied onto the PDA as a whole (I'm trying to implement it so that a storage card can be plugged into the PDA and off you go).

    I can't say I consider the setup very stable; I'm running it on both the WM2005 emulator (which has the db4o no-data behaviour) and on a Qtek 9000 which does show the DB4O data, then J9 decides to crash, on the next run it complaints from the start that it has not enough memory while several dozend MB's are available.

    So maybe I should be switching to DotNet Mobile after all...

  •  06-06-2006, 04:21 PM 25582 in reply to 25247

    Re: DB4O on PDA IBM J9 - no data

    I threw out SWT (but kept DB4O) and switched to AWT; things seems to be more stable now. But I still have behaviour differences: on the emulator the AWT close event is handled correctly, on the QTek 9000 not. Same J9, same jars. Very very very strange.

    Anyhow my DB4O issue seems to have dissappeared. Thanks.

  •  06-08-2006, 03:31 PM 25661 in reply to 25582

    Re: DB4O on PDA IBM J9 - no data

    I do not use SWT, just AWT. I'm not going to go near SWT, although I hope that a JSR209 does become available.

    DB4O works very well for me and is by fat the best DB type solution I have found, since memory is tight on these devices. Derby and HSQL are still too greedy.

    As for the close comment. Press the X on the J9 frame does not actailly signal windowsClosing, but is hooked to the windowIconifying event ;)
View as RSS news feed in XML