SF [2643953] Improve Data::Session connection

This commit is contained in:
Aleksandar Fabijanic
2009-02-27 03:14:53 +00:00
parent 9bef44cab6
commit 68a79674c1
50 changed files with 689 additions and 165 deletions

View File

@@ -45,6 +45,7 @@
#include "Poco/SharedPtr.h"
#include "Poco/DateTime.h"
#include "Poco/Exception.h"
#include "Poco/Data/DataException.h"
using Poco::icompare;
@@ -74,6 +75,9 @@ StatementImpl::StatementImpl(SessionImpl& rSession):
_bulkBinding(BULK_UNDEFINED),
_bulkExtraction(BULK_UNDEFINED)
{
if (!_rSession.isConnected())
throw NotConnectedException(_rSession.connectionString());
_extractors.resize(1);
_columnsExtracted.resize(1, 0);
}
@@ -87,6 +91,13 @@ StatementImpl::~StatementImpl()
std::size_t StatementImpl::execute()
{
resetExtraction();
if (!_rSession.isConnected())
{
_state = ST_DONE;
throw NotConnectedException(_rSession.connectionString());
}
std::size_t lim = 0;
if (_lowerLimit > _extrLimit.value())
throw LimitException("Illegal Statement state. Upper limit must not be smaller than the lower limit.");