summaryrefslogtreecommitdiff
path: root/project2/rdbmsDataSource.h
diff options
context:
space:
mode:
Diffstat (limited to 'project2/rdbmsDataSource.h')
-rw-r--r--project2/rdbmsDataSource.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/project2/rdbmsDataSource.h b/project2/rdbmsDataSource.h
index bb1047a..77fbe3a 100644
--- a/project2/rdbmsDataSource.h
+++ b/project2/rdbmsDataSource.h
@@ -9,7 +9,16 @@
class _RdbmsDataSource : public _DataSource {
public:
- typedef boost::shared_ptr<ODBC::Connection> ConnectionPtr;
+ class RdbmsConnection : public ODBC::Connection {
+ public:
+ RdbmsConnection(const std::string & dsn, time_t keepAliveTime);
+ void touch() const;
+ bool isExpired() const;
+ private:
+ mutable time_t lastUsedTime;
+ const time_t keepAliveTime;
+ };
+ typedef boost::shared_ptr<RdbmsConnection> ConnectionPtr;
typedef std::map<std::string, std::string> ReadonlyDSNs; // Map hostname to DSN string
typedef std::map<std::string, ConnectionPtr> DBHosts; // Map DSN strings to connections
typedef std::map<std::string, const ODBC::ConnectionError> FailedHosts; // Map DSN strings to failures