@@ -35,8 +35,16 @@ namespace oatpp { namespace postgresql {
3535/* *
3636 * Connection provider.
3737 */
38- class ConnectionProvider : public provider ::Provider<Connection> {
38+ class ConnectionProvider : public provider ::Provider<orm:: Connection> {
3939private:
40+
41+ class ConnectionInvalidator : public provider ::Invalidator<orm::Connection> {
42+ public:
43+ void invalidate (const std::shared_ptr<orm::Connection>& resource) override ;
44+ };
45+
46+ private:
47+ std::shared_ptr<ConnectionInvalidator> m_invalidator;
4048 oatpp::String m_connectionString;
4149public:
4250
@@ -50,19 +58,13 @@ class ConnectionProvider : public provider::Provider<Connection> {
5058 * Get Connection.
5159 * @return - resource.
5260 */
53- std::shared_ptr< Connection> get () override ;
61+ provider::ResourceHandle<orm:: Connection> get () override ;
5462
5563 /* *
5664 * Get Connection in Async manner.
5765 * @return - &id:oatpp::async::CoroutineStarterForResult; of `Connection`.
5866 */
59- async::CoroutineStarterForResult<const std::shared_ptr<Connection>&> getAsync () override ;
60-
61- /* *
62- * Invalidate Connection that was previously created by this provider. <br>
63- * @param resource
64- */
65- void invalidate (const std::shared_ptr<Connection>& resource) override ;
67+ async::CoroutineStarterForResult<const provider::ResourceHandle<orm::Connection>&> getAsync () override ;
6668
6769 /* *
6870 * Stop provider and free associated resources.
@@ -77,7 +79,7 @@ class ConnectionProvider : public provider::Provider<Connection> {
7779 * - &id:oatpp::postgresql::ConnectionAcquisitionProxy;.
7880 */
7981typedef oatpp::provider::Pool<
80- provider::Provider<Connection>,
82+ provider::Provider<orm:: Connection>,
8183 Connection,
8284 ConnectionAcquisitionProxy
8385> ConnectionPool;
0 commit comments