/*
*
* ProLinga-Run
*
* Copyright (C) 2002-2009 Xobas Software.
* All rights reserved.
*
* This file is part of ProLinga-Run.
*
* ProLinga-Run is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ProLinga-Run is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ProLinga-Run. If not, see .
*
* More information is available at the following addresses:
*
* Website : http://www.prolinga.org
*
* Email : prolinga-list@prolinga.org
*
*
*/
#include "RunCommon.h"
#include
#include
#include
#include "LogicCommands.hpp"
#include "DataRef.hpp"
#include "BuiltIn.hpp"
#include "DataCommand.hpp"
extern BiSqlStatusPtr biSqlStatusPtr;
/* Command : TRANSACTION */
/* Syntax : TRANSACTION BEGIN "data_source_name" [ISOLATION isolation_level] */
/* Syntax : TRANSACTION COMMIT "data_source_name" */
/* Syntax : TRANSACTION ROLLBACK "data_source_name" */
void CmdTransaction(const char **argList, int argHits, bool isMainThread)
{
char retValue[255];
/* Get option */
if (strcmp(argList[1], "BEGIN") == 0)
{
if (argHits == 4)
biSqlStatusPtr->setSqlStatus(dataTransaction(getDataRef(argList[2], isMainThread, retValue, false), "Begin", argList[4]));
else
biSqlStatusPtr->setSqlStatus(dataTransaction(getDataRef(argList[2], isMainThread, retValue, false), "Begin", "Serializable"));
}
else if (strcmp(argList[1], "COMMIT") == 0)
{
biSqlStatusPtr->setSqlStatus(dataTransaction(getDataRef(argList[2], isMainThread, retValue, false), "Commit", NULL));
}
else if (strcmp(argList[1], "ROLLBACK") == 0)
{
biSqlStatusPtr->setSqlStatus(dataTransaction(getDataRef(argList[2], isMainThread, retValue, false), "Rollback", NULL));
}
/* Return */
return;
}