/*
* TODO: set the running flag to true -> ClientRequests
*/
Connection conn = this.middeware.getConnection(uuid);
if(conn == null){
throw new MiddlewareException("THREAD "+Thread.currentThread().getId()+" / EXCEPTION in UpdateQueryJob for UUID="+
uuid.variant()+" -> There are no connecton available for this " +
"client-uuid in the Middleware\n");
} else {
synchronized (conn) {
Vector<Connection> connPool = this.middeware.getConnectionPool(uuid);
if(connPool == null){
/*
* create a pool of connection to all other DBs
*/
this.middeware.addNewConnectionPool(uuid);
connPool = this.middeware.getConnectionPool(uuid);
} else {
System.out.println("THREAD "+Thread.currentThread().getId()+" / >> CONNECTIONPOOL exist -> "+uuid);
}
synchronized (connPool) {
try{
try {
uf.onResult(Transactions.executeUpdateShoppingCartToAll(conn, connPool));
uf.done(true);
connPool.notify();
} catch (SQLException e) {
throw new MiddlewareException("QUERY ERROR: " + e.getMessage(), e);
}
}catch(MiddlewareException me)
{
uf.done(false);
}