709 """return a function forwarding calls to transaction. |
709 """return a function forwarding calls to transaction. |
710 |
710 |
711 This is to be used by session""" |
711 This is to be used by session""" |
712 def meth_from_tx(session, *args, **kwargs): |
712 def meth_from_tx(session, *args, **kwargs): |
713 return getattr(session._tx, meth_name)(*args, **kwargs) |
713 return getattr(session._tx, meth_name)(*args, **kwargs) |
|
714 meth_from_tx.__doc__ = getattr(Transaction, meth_name).__doc__ |
714 return meth_from_tx |
715 return meth_from_tx |
715 |
716 |
716 |
717 |
717 class Session(RequestSessionBase): |
718 class Session(RequestSessionBase): |
718 """Repository user session |
719 """Repository user session |
765 :attr:`cnxset`, the connections set to use to execute queries on sources. |
766 :attr:`cnxset`, the connections set to use to execute queries on sources. |
766 During a transaction, the connection set may be freed so that is may be |
767 During a transaction, the connection set may be freed so that is may be |
767 used by another session as long as no writing is done. This means we can |
768 used by another session as long as no writing is done. This means we can |
768 have multiple sessions with a reasonably low connections set pool size. |
769 have multiple sessions with a reasonably low connections set pool size. |
769 |
770 |
770 .. automethod:: cubicweb.server.session.set_cnxset |
771 .. automethod:: cubicweb.server.session.Session.set_cnxset |
771 .. automethod:: cubicweb.server.session.free_cnxset |
772 .. automethod:: cubicweb.server.session.Session.free_cnxset |
772 |
773 |
773 :attr:`mode`, string telling the connections set handling mode, may be one |
774 :attr:`mode`, string telling the connections set handling mode, may be one |
774 of 'read' (connections set may be freed), 'write' (some write was done in |
775 of 'read' (connections set may be freed), 'write' (some write was done in |
775 the connections set, it can't be freed before end of the transaction), |
776 the connections set, it can't be freed before end of the transaction), |
776 'transaction' (we want to keep the connections set during all the |
777 'transaction' (we want to keep the connections set during all the |