diff --git a/ReleaseNotes.html b/ReleaseNotes.html index eabefe8def..373edeeb74 100644 --- a/ReleaseNotes.html +++ b/ReleaseNotes.html @@ -102,6 +102,7 @@

Release 3.3.8 (July 2017)

RESTful services is planned in a future release.
  • Added Wt::Dbo::FixedSqlConnectionPool::setTimeout(), to set a timeout for obtaining a connection.
  • Added Wt::Dbo::backend::Postgres::setTimeout(), to set a timeout for queries.
  • +
  • Added libunwind support for printing stacktraces. Enable this with the ENABLE_UNWIND CMake option.
  • diff --git a/src/Wt/Dbo/Session b/src/Wt/Dbo/Session index d3c8cb93f3..b786f4f0f7 100644 --- a/src/Wt/Dbo/Session +++ b/src/Wt/Dbo/Session @@ -136,7 +136,17 @@ public: * through it, and will warning during this destructor if there are * still database objects that are being referenced from a ptr. */ - ~Session(); + virtual ~Session(); + +#ifdef WT_CXX11 + // Sessions are not copyable + Session(const Session &) = delete; + Session& operator=(const Session &) = delete; + + // Sessions are not movable + Session(Session &&) = delete; + Session& operator=(Session &&) = delete; +#endif // WT_CXX11 /*! \brief Sets a dedicated connection. * @@ -483,11 +493,15 @@ public: void setFlushMode(FlushMode mode) { flush(); flushMode_ = mode; } private: - mutable std::string longlongType_; mutable std::string intType_; mutable bool haveSupportUpdateCascade_; + +#ifndef WT_CXX11 + // Sessions are not copyable Session(const Session& s); + Session& operator=(const Session& s); +#endif // WT_CXX11 typedef boost::multi_index::multi_index_container< MetaDboBase *, diff --git a/src/Wt/Dbo/Transaction b/src/Wt/Dbo/Transaction index 7c29876b60..f6ef71d5db 100644 --- a/src/Wt/Dbo/Transaction +++ b/src/Wt/Dbo/Transaction @@ -82,7 +82,17 @@ public: * * If the transaction is still active, it is rolled back. */ - ~Transaction() WT_CXX11ONLY(noexcept(false)); + virtual ~Transaction() WT_CXX11ONLY(noexcept(false)); + +#ifdef WT_CXX11 + // Transactions are not copyable + Transaction(const Transaction&) = delete; + Transaction& operator=(const Transaction&) = delete; + + // Transactions are not movable + Transaction(Transaction&&) = delete; + Transaction& operator=(Transaction&&) = delete; +#endif // WT_CXX11 /*! \brief Returns whether the transaction is still active. * @@ -126,6 +136,12 @@ public: SqlConnection *connection() const; private: +#ifndef WT_CXX11 + // Transactions should not be copied + Transaction(const Transaction& other); + Transaction& operator=(const Transaction& other); +#endif // WT_CXX11 + struct Impl { Session& session_; bool active_; diff --git a/src/Wt/Dbo/backend/MySQL.C b/src/Wt/Dbo/backend/MySQL.C index c73b635657..fb4d173c4d 100644 --- a/src/Wt/Dbo/backend/MySQL.C +++ b/src/Wt/Dbo/backend/MySQL.C @@ -994,12 +994,14 @@ void MySQL::checkConnection() err_nb = mysql_errno(impl_->mysql); err = std::string(mysql_error(impl_->mysql)); } - if (err_nb == CR_SERVER_GONE_ERROR) { + if (err_nb == CR_SERVER_GONE_ERROR || + err_nb == CR_SERVER_LOST) { clearStatementCache(); mysql_close(impl_->mysql); impl_->mysql = 0; try { connect(dbname_, dbuser_, dbpasswd_, dbhost_, dbport_, dbsocket_); + return; } catch (MySQLException e) { throw MySQLException("checkConnection: Error when reconnecting: " + std::string(e.what())); } diff --git a/src/Wt/Dbo/backend/Postgres.C b/src/Wt/Dbo/backend/Postgres.C index dc9db9f8d7..8063711335 100644 --- a/src/Wt/Dbo/backend/Postgres.C +++ b/src/Wt/Dbo/backend/Postgres.C @@ -641,7 +641,8 @@ void Postgres::disconnect() /* Evict also the statements -- the statements themselves can stay, only running statements behavior is affected (but we are dealing with that while calling disconnect) */ - for (auto s : statements) { + for (std::size_t i = 0; i < statements.size(); ++i) { + SqlStatement *s = statements[i]; PostgresStatement *ps = dynamic_cast(s); ps->rebuild(); } diff --git a/src/Wt/WWebWidget.C b/src/Wt/WWebWidget.C index 8110b86650..6455e929af 100644 --- a/src/Wt/WWebWidget.C +++ b/src/Wt/WWebWidget.C @@ -709,19 +709,16 @@ void WWebWidget::calcZIndex() WWebWidget *ww = parentWebWidget(); if (ww) { - if (ww == Wt::WApplication::instance()->domRoot()) { - layoutImpl_->zIndex_ = baseZIndex(); - } else { - const std::vector& children = ww->children(); + const std::vector& children = ww->children(); - int maxZ = 0; - for (unsigned i = 0; i < children.size(); ++i) { - WWebWidget *wi = children[i]->webWidget(); + int maxZ = 0; + for (unsigned i = 0; i < children.size(); ++i) { + WWebWidget *wi = children[i]->webWidget(); + if (wi->baseZIndex() <= baseZIndex()) maxZ = std::max(maxZ, wi->zIndex()); - } - - layoutImpl_->zIndex_ = maxZ + 100; } + + layoutImpl_->zIndex_ = std::max(baseZIndex(), maxZ + 100); } }