on 01-04-2007 12:13 PM
Dear mobile gurus:
We are facing some problems with an application with persistence. The issue is described below:
We have an application with persistence, inserting data in DB2e in order to consult these data afterwards. The solution works OK when we maintain the session. The issue raises when we restart (close and start) the application and we are not able to recover the persistence data.
The code we are using to initialize the transaction is:
private static PersistenceRuntime persistence;
private static PersistenceManager perManager;
private static MaestroPersistencia master;
public static void setupPersistenceRuntime()
{
try {
persistence = PersistenceRuntime.getInstance();
master = new MaestroPersistencia();
persistence.registerPersistenceMaster(master);
perManager = persistence.getPersistenceManager(VisibilityType.SEPARATED);
perManager.registerEntityFactory(master);
perManager.beginTransaction(true);
} catch (Exception e) {
e.printStackTrace();
System.out.println("Error during startup");
System.exit(-1);
}
}
Once the application is initialized (see code shown above), we made an insertion in the data base and in its correspondent commit. Next, we reinitialized the client and we would like to consult the data recorded in the data base. Unfortunatelly, we have an error message, perManager is null.
We think that the problem occurs in code sentence:
" perManager.beginTransaction(true) "
Could anybody give some ideas to solve this issue?
Regards
Satur
hi satur,
do you have any logs or trace in the client? what is the exception message?
does your implementation MaestroPersistencia properly returns that classtypes
and the corresponding ClassDescriptor for the following interface methods?
public String[] getClasstypes();
public ClassDescriptor getClassDescriptor(String classtype);
regards
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.