diff options
-rw-r--r-- | doc/manual.xhtml | 10 | ||||
-rw-r--r-- | odb/relational/source.cxx | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/manual.xhtml b/doc/manual.xhtml index a3232b0..b417ced 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -11605,14 +11605,17 @@ odb --hxx-prologue "#include \"app/session.hxx\"" \ class custom_session { public: + static bool + _has_cache (); + + // Cache management functions. + // template <typename T> struct cache_position { ... }; - // Cache management functions. - // template <typename T> static cache_position<T> _cache_insert (odb::database&, @@ -11649,6 +11652,9 @@ public: }; </pre> + <p>The <code>_has_cache()</code> function shall return <code>true</code> + if the object cache is in effect in the current thread.</p> + <p>The <code>cache_position</code> class template represents a position in the cache of the inserted object. It should be default and copy-constructible as well as copy-assignable. The default diff --git a/odb/relational/source.cxx b/odb/relational/source.cxx index a20406a..4e9a069 100644 --- a/odb/relational/source.cxx +++ b/odb/relational/source.cxx @@ -5235,7 +5235,7 @@ traverse_view (type& c) os << endl; if (need_session) - os << "if (!session::has_current ())" << endl + os << "if (!" << options.session_type () << "::_has_cache ())" << endl << "throw session_required ();" << endl; |