cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with persistence application

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

In our code We have implemented both methods you talk about.

Could you tell us how we can send you the trace?

Regards

Satur

Former Member
0 Kudos

hello satur,

send me the trace files and if possible your implementation of the persistence APIs.

zip it and email to jogel.sdn[at]gmail.com (just change [at] to @) .

regards

jo