mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
SF [2643953] Improve Data::Session connection
This commit is contained in:
@@ -65,7 +65,8 @@ public:
|
||||
const std::string& name() const;
|
||||
/// Returns the name associated with this connector.
|
||||
|
||||
Poco::AutoPtr<Poco::Data::SessionImpl> createSession(const std::string& connectionString);
|
||||
Poco::AutoPtr<Poco::Data::SessionImpl> createSession(const std::string& connectionString,
|
||||
std::size_t timeout = Poco::Data::SessionImpl::CONNECT_TIMEOUT_DEFAULT);
|
||||
/// Creates a SQLite SessionImpl object and initializes it with the given connectionString.
|
||||
|
||||
static void registerConnector();
|
||||
|
||||
@@ -59,7 +59,8 @@ class SQLite_API SessionImpl: public Poco::Data::AbstractSessionImpl<SessionImpl
|
||||
/// Implements SessionImpl interface.
|
||||
{
|
||||
public:
|
||||
SessionImpl(const std::string& fileName);
|
||||
SessionImpl(const std::string& fileName,
|
||||
std::size_t timeout = CONNECT_TIMEOUT_DEFAULT);
|
||||
/// Creates the SessionImpl. Opens a connection to the database.
|
||||
|
||||
~SessionImpl();
|
||||
@@ -77,6 +78,9 @@ public:
|
||||
void rollback();
|
||||
/// Aborts a transaction.
|
||||
|
||||
void open(const std::string& connect = "");
|
||||
/// Opens a connection to the Database.
|
||||
|
||||
void close();
|
||||
/// Closes the session.
|
||||
|
||||
@@ -107,8 +111,6 @@ public:
|
||||
/// Returns the name of the connector.
|
||||
|
||||
private:
|
||||
void open();
|
||||
/// Opens a connection to the Database.
|
||||
|
||||
std::string _connector;
|
||||
sqlite3* _pDB;
|
||||
|
||||
Reference in New Issue
Block a user