cancel
Showing results for 
Search instead for 
Did you mean: 

UltraliteJ Connection Release alter successful and failed synchronizations

Former Member
4,455

Hi All,

I’m using UltraliteJ 12.0.1.3769 on Android 3.1 and I have a doubt about when to release connections used for synchronizing Ultralite.

Connectecion.release() for UltraliteJ documentation says: “It is an error to attempt to release a connection for which there exist uncommitted transactions”, but I’m not sure whether there are uncommitted transactions after synchronization successful or failure. Please, have a look to the next code example:

try{
Connection conexion=DatabaseManager.connect(config);
...
conexion.synchronize( syncParms )
// Here, i belive transanction is commited
// so i can release connection.
// Is this correct?
conexion.release();

}catch(ULjException ex){

// Here transaction is rolledback
// so i can release safety connection.
// Is this correct?
conexion.release();
}

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

philippefbertrand
Participant

If a synchronization fails, the download will be either be rolled back or a partial download will be be saved (if you requested it). In both cases, there will be no uncommitted transactions and it will be ok to release the connection.

Former Member
0 Kudos

Ok, thanks Philippe.

VolkerBarth
Contributor
0 Kudos

@David: It this has helped, I'd recommend to accept that answer as "accepted" - for a HOWTO, you may look here...

Answers (0)