]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
First tests OK.
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 21 Jul 2015 14:08:09 +0000 (16:08 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 21 Jul 2015 14:08:09 +0000 (16:08 +0200)
idl/SALOME_SDS.idl
src/SALOMESDS/SALOMESDS_DataScopeServer.cxx
src/SALOMESDS/SALOMESDS_KeyWaiter.cxx

index d26c2ad58819a83b8400fc06c19648454e89d9ec..b6685b0ba4c985da4847f4f87abf242496844f2f 100644 (file)
@@ -92,6 +92,7 @@ module SALOME
     Transaction createRdOnlyVarTransac(in string varName, in ByteVec constValue) raises (SALOME::SALOME_Exception);
     Transaction createRdExtVarTransac(in string varName, in ByteVec constValue) raises (SALOME::SALOME_Exception);
     Transaction createRdWrVarTransac(in string varName, in ByteVec constValue) raises (SALOME::SALOME_Exception);
+    Transaction addKeyValueInVarHard(in string varName, in ByteVec keyValue, in ByteVec constValue) raises (SALOME::SALOME_Exception);
     KeyWaiter waitForKeyInVar(in string varName, in ByteVec keyVal) raises (SALOME::SALOME_Exception);
     void atomicApply(in ListOfTransaction transactions) raises (SALOME::SALOME_Exception);
   };
index e1c35d1271555cf4efacd588cadc8b28e0080696..0c5c3506eaf9abffe710f1ced02abfb411ba3b8f 100644 (file)
@@ -331,7 +331,16 @@ DataScopeServerTransaction::DataScopeServerTransaction(CORBA::ORB_ptr orb, const
 {
   CORBA::Object_var obj(_orb->resolve_initial_references("RootPOA"));
   PortableServer::POA_var poa(PortableServer::POA::_narrow(obj));
-  _poa_for_key_waiter=poa;
+  //
+  PortableServer::POAManager_var mgr(poa->the_POAManager());
+  CORBA::PolicyList policies;
+  policies.length(1);
+  PortableServer::ThreadPolicy_var threadPol(poa->create_thread_policy(PortableServer::ORB_CTRL_MODEL));
+  policies[0]=PortableServer::ThreadPolicy::_duplicate(threadPol);
+  PortableServer::POA_var poa2(poa->create_POA("POAForWaiters",mgr,policies));
+  threadPol->destroy();
+  //
+  _poa_for_key_waiter=poa2;
 }
 
 DataScopeServerTransaction::DataScopeServerTransaction(const DataScopeServerTransaction& other):DataScopeServerBase(other),_poa_for_key_waiter(other.getPOA4KeyWaiter())
@@ -477,7 +486,7 @@ void DataScopeServerTransaction::notifyKey(PyObject *keyObj, PyObject *valueObj)
 
 SALOME::Transaction_ptr DataScopeServerTransaction::addKeyValueInVarHard(const char *varName, const SALOME::ByteVec& key, const SALOME::ByteVec& value)
 {
-  checkNotAlreadyExistingVar(varName);
+  checkVarExistingAndDict(varName);
   TransactionAddKeyValueHard *ret(new TransactionAddKeyValueHard(this,varName,key,value));
   CORBA::Object_var obj(ret->activate());
   return SALOME::Transaction::_narrow(obj);
@@ -495,7 +504,7 @@ class TrustTransaction
 {
 public:
   TrustTransaction():_must_rollback(0),_ptr(0) { }
-  void setTransaction(Transaction *t, bool *mustRollback) { if(!t || !mustRollback) throw Exception("TrustTransaction Error #1"); _must_rollback=mustRollback; t->prepareRollBackInCaseOfFailure(); }
+  void setTransaction(Transaction *t, bool *mustRollback) { if(!t || !mustRollback) throw Exception("TrustTransaction Error #1"); _ptr=t; _must_rollback=mustRollback; _ptr->prepareRollBackInCaseOfFailure(); }
   void operate() { _ptr->perform(); }
   ~TrustTransaction() { if(!_ptr) return ; if(*_must_rollback) _ptr->rollBack(); }
 private:
index 0c28da39d09642d7f791f2c88680bb7d581cf98c..ecc3a9148383b88ed6afdcbf090f0cd52ba8c0ed 100644 (file)
@@ -85,7 +85,9 @@ SALOME::ByteVec *KeyWaiter::waitFor()
     throw Exception("KeyWaiter::waitFor : internal error !");
   Py_XINCREF(_ze_value);
   std::string st(PickelizedPyObjServer::Pickelize(_ze_value,_var->getFather()));
-  return PickelizedPyObjServer::FromCppToByteSeq(st);
+  SALOME::ByteVec *ret(PickelizedPyObjServer::FromCppToByteSeq(st));
+  enforcedRelease();
+  return ret;
 }
 
 /*!