mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 20:59:45 +01:00
changed set|getTimeout() => set|getLoginTimeout()
added set|getConnectionTimeout()
This commit is contained in:
@@ -73,7 +73,7 @@ public:
|
||||
/// The getter method for a property.
|
||||
|
||||
AbstractSessionImpl(const std::string& connectionString,
|
||||
std::size_t timeout = CONNECT_TIMEOUT_DEFAULT): SessionImpl(connectionString, timeout),
|
||||
std::size_t timeout = LOGIN_TIMEOUT_DEFAULT): SessionImpl(connectionString, timeout),
|
||||
_storage(std::string("deque")),
|
||||
_bulk(false),
|
||||
_emptyStringIsNull(false),
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
/// Returns the name associated with this connector.
|
||||
|
||||
virtual Poco::AutoPtr<SessionImpl> createSession(const std::string& connectionString,
|
||||
std::size_t timeout = SessionImpl::CONNECT_TIMEOUT_DEFAULT) = 0;
|
||||
std::size_t timeout = SessionImpl::LOGIN_TIMEOUT_DEFAULT) = 0;
|
||||
/// Create a SessionImpl object and initialize it with the given connectionString.
|
||||
};
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ public:
|
||||
void open(const std::string& connect = "");
|
||||
void close();
|
||||
bool isConnected();
|
||||
void setConnectionTimeout(std::size_t timeout);
|
||||
std::size_t getConnectionTimeout();
|
||||
bool canTransact();
|
||||
bool isTransaction();
|
||||
void setTransactionIsolation(Poco::UInt32);
|
||||
|
||||
@@ -173,7 +173,7 @@ class Data_API Session
|
||||
/// For complete list of supported data types with their respective specifications, see the documentation for format in Foundation.
|
||||
{
|
||||
public:
|
||||
static const std::size_t CONNECT_TIMEOUT_DEFAULT = SessionImpl::CONNECT_TIMEOUT_DEFAULT;
|
||||
static const std::size_t LOGIN_TIMEOUT_DEFAULT = SessionImpl::LOGIN_TIMEOUT_DEFAULT;
|
||||
static const Poco::UInt32 TRANSACTION_READ_UNCOMMITTED = 0x00000001L;
|
||||
static const Poco::UInt32 TRANSACTION_READ_COMMITTED = 0x00000002L;
|
||||
static const Poco::UInt32 TRANSACTION_REPEATABLE_READ = 0x00000004L;
|
||||
@@ -184,12 +184,12 @@ public:
|
||||
|
||||
Session(const std::string& connector,
|
||||
const std::string& connectionString,
|
||||
std::size_t timeout = CONNECT_TIMEOUT_DEFAULT);
|
||||
std::size_t timeout = LOGIN_TIMEOUT_DEFAULT);
|
||||
/// Creates a new session, using the given connector (which must have
|
||||
/// been registered), and connectionString.
|
||||
|
||||
Session(const std::string& connection,
|
||||
std::size_t timeout = CONNECT_TIMEOUT_DEFAULT);
|
||||
std::size_t timeout = LOGIN_TIMEOUT_DEFAULT);
|
||||
/// Creates a new session, using the given connection (must be in
|
||||
/// "connection:///connectionString" format).
|
||||
|
||||
@@ -232,11 +232,17 @@ public:
|
||||
void reconnect();
|
||||
/// Closes the session and opens it.
|
||||
|
||||
void setTimeout(std::size_t timeout);
|
||||
/// Sets the session timeout value.
|
||||
void setLoginTimeout(std::size_t timeout);
|
||||
/// Sets the session login timeout value.
|
||||
|
||||
std::size_t getTimeout() const;
|
||||
/// Returns the session timeout value.
|
||||
std::size_t getLoginTimeout() const;
|
||||
/// Returns the session login timeout value.
|
||||
|
||||
void setConnectionTimeout(std::size_t timeout);
|
||||
/// Sets the session connection timeout value.
|
||||
|
||||
std::size_t getConnectionTimeout();
|
||||
/// Returns the session connection timeout value.
|
||||
|
||||
void begin();
|
||||
/// Starts a transaction.
|
||||
@@ -355,15 +361,27 @@ inline void Session::reconnect()
|
||||
}
|
||||
|
||||
|
||||
inline void Session::setTimeout(std::size_t timeout)
|
||||
inline void Session::setLoginTimeout(std::size_t timeout)
|
||||
{
|
||||
_pImpl->setTimeout(timeout);
|
||||
_pImpl->setLoginTimeout(timeout);
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t Session::getTimeout() const
|
||||
inline std::size_t Session::getLoginTimeout() const
|
||||
{
|
||||
return _pImpl->getTimeout();
|
||||
return _pImpl->getLoginTimeout();
|
||||
}
|
||||
|
||||
|
||||
inline void Session::setConnectionTimeout(std::size_t timeout)
|
||||
{
|
||||
_pImpl->setConnectionTimeout(timeout);
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t Session::getConnectionTimeout()
|
||||
{
|
||||
return _pImpl->getConnectionTimeout();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -85,12 +85,12 @@ public:
|
||||
|
||||
Session create(const std::string& key,
|
||||
const std::string& connectionString,
|
||||
std::size_t timeout = Session::CONNECT_TIMEOUT_DEFAULT);
|
||||
std::size_t timeout = Session::LOGIN_TIMEOUT_DEFAULT);
|
||||
/// Creates a Session for the given key with the connectionString. Throws an Poco:Data::UnknownDataBaseException
|
||||
/// if no Connector is registered for that key.
|
||||
|
||||
Session create(const std::string& uri,
|
||||
std::size_t timeout = Session::CONNECT_TIMEOUT_DEFAULT);
|
||||
std::size_t timeout = Session::LOGIN_TIMEOUT_DEFAULT);
|
||||
/// Creates a Session for the given URI (must be in key:///connectionString format).
|
||||
/// Throws an Poco:Data::UnknownDataBaseException if no Connector is registered for the key.
|
||||
|
||||
|
||||
@@ -59,14 +59,20 @@ class Data_API SessionImpl: public Poco::RefCountedObject
|
||||
/// SessionImpl objects are noncopyable.
|
||||
{
|
||||
public:
|
||||
static const std::size_t CONNECT_TIMEOUT_INFINITE = 0;
|
||||
static const std::size_t LOGIN_TIMEOUT_INFINITE = 0;
|
||||
/// Infinite connection/login timeout.
|
||||
|
||||
static const std::size_t CONNECT_TIMEOUT_DEFAULT = 30;
|
||||
static const std::size_t LOGIN_TIMEOUT_DEFAULT = 60;
|
||||
/// Default connection/login timeout in seconds.
|
||||
|
||||
static const std::size_t CONNECTION_TIMEOUT_INFINITE = 0;
|
||||
/// Infinite connection/login timeout.
|
||||
|
||||
static const std::size_t CONNECTION_TIMEOUT_DEFAULT = CONNECTION_TIMEOUT_INFINITE;
|
||||
/// Default connection/login timeout in seconds.
|
||||
|
||||
SessionImpl(const std::string& connectionString,
|
||||
std::size_t timeout = CONNECT_TIMEOUT_DEFAULT);
|
||||
std::size_t timeout = LOGIN_TIMEOUT_DEFAULT);
|
||||
/// Creates the SessionImpl.
|
||||
|
||||
virtual ~SessionImpl();
|
||||
@@ -89,11 +95,17 @@ public:
|
||||
virtual bool isConnected() = 0;
|
||||
/// Returns true if session is connected, false otherwise.
|
||||
|
||||
void setTimeout(std::size_t timeout);
|
||||
/// Sets the session timeout value.
|
||||
void setLoginTimeout(std::size_t timeout);
|
||||
/// Sets the session login timeout value.
|
||||
|
||||
std::size_t getTimeout() const;
|
||||
/// Returns the session timeout value.
|
||||
std::size_t getLoginTimeout() const;
|
||||
/// Returns the session login timeout value.
|
||||
|
||||
virtual void setConnectionTimeout(std::size_t timeout) = 0;
|
||||
/// Sets the session connection timeout value.
|
||||
|
||||
virtual std::size_t getConnectionTimeout() = 0;
|
||||
/// Returns the session connection timeout value.
|
||||
|
||||
void reconnect();
|
||||
/// Closes the connection and opens it again.
|
||||
@@ -187,7 +199,7 @@ private:
|
||||
SessionImpl& operator = (const SessionImpl&);
|
||||
|
||||
std::string _connectionString;
|
||||
std::size_t _timeout;
|
||||
std::size_t _loginTimeout;
|
||||
};
|
||||
|
||||
|
||||
@@ -200,15 +212,15 @@ inline const std::string& SessionImpl::connectionString()
|
||||
}
|
||||
|
||||
|
||||
inline void SessionImpl::setTimeout(std::size_t timeout)
|
||||
inline void SessionImpl::setLoginTimeout(std::size_t timeout)
|
||||
{
|
||||
_timeout = timeout;
|
||||
_loginTimeout = timeout;
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t SessionImpl::getTimeout() const
|
||||
inline std::size_t SessionImpl::getLoginTimeout() const
|
||||
{
|
||||
return _timeout;
|
||||
return _loginTimeout;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user