things to get more infos for debugging

This commit is contained in:
einhorn_b 2021-06-16 12:49:58 +02:00
parent 7785a0b5a6
commit 0093ae8834
4 changed files with 31 additions and 12 deletions

View File

@ -289,7 +289,7 @@ class AppController extends Controller
}
} else {
if(!$redirect) {
return ['state' => 'not found', 'msg' => 'invalid session'];
return ['state' => 'not found', 'msg' => 'invalid session', 'details' => $json];
}
if ($json['state'] === 'not found') {
$this->Flash->error(__('invalid session'));

View File

@ -359,7 +359,8 @@ namespace model {
//UniLib::controller::TaskPtr transaction_send_task(new SendTransactionTask(Poco::AutoPtr<Transaction>(this, true)));
//transaction_send_task->scheduleTask(transaction_send_task);
auto pt = PendingTasksManager::getInstance();
pt->removeTask(this);
pt->removeTask(Poco::AutoPtr<Transaction>(this, true));
return 1 == runSendTransaction();
//return true;
}

View File

@ -124,21 +124,35 @@ namespace model {
void ModelBase::duplicate()
{
Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
//Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
std::string stack_details = "[ModelBase::duplicate] table: ";
stack_details += getTableName();
lock(stack_details.data());
mReferenceCount++;
printf("[ModelBase::duplicate] new value: %d, table name: %s\n", mReferenceCount, getTableName());
unlock();
//printf("[ModelBase::duplicate] new value: %d\n", mReferenceCount);
}
void ModelBase::release()
{
Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
mReferenceCount--;
//printf("[ModelBase::release] new value: %d\n", mReferenceCount);
if (0 == mReferenceCount) {
if(mReferenceCount <= 0) {
throw Poco::Exception("ModelBase already released", getTableName());
}
std::string stack_details = "[ModelBase::release] table: ";
stack_details += getTableName();
stack_details += ", reference count: ";
stack_details += std::to_string(mReferenceCount);
lock(stack_details.data());
mReferenceCount--;
printf("[ModelBase::release] new value: %d, table name: %s\n", mReferenceCount, getTableName());
if (0 == mReferenceCount) {
unlock();
delete this;
return;
}
unlock();
}

View File

@ -70,7 +70,11 @@ namespace model
{
SHARED_LOCK;
temp = mResultJsonString;
if(!mResultJsonString.size()) {
return new Poco::JSON::Object;
}
}
Poco::JSON::Parser parser;
Poco::Dynamic::Var result;
try