667 def check_session(self, sessionid): |
667 def check_session(self, sessionid): |
668 """raise `BadConnectionId` if the connection is no more valid, else |
668 """raise `BadConnectionId` if the connection is no more valid, else |
669 return its latest activity timestamp. |
669 return its latest activity timestamp. |
670 """ |
670 """ |
671 return self._get_session(sessionid, setcnxset=False).timestamp |
671 return self._get_session(sessionid, setcnxset=False).timestamp |
672 |
|
673 @deprecated('[3.19] use session or transaction data') |
|
674 def get_shared_data(self, sessionid, key, default=None, pop=False, txdata=False): |
|
675 """return value associated to key in the session's data dictionary or |
|
676 session's transaction's data if `txdata` is true. |
|
677 |
|
678 If pop is True, value will be removed from the dictionary. |
|
679 |
|
680 If key isn't defined in the dictionary, value specified by the |
|
681 `default` argument will be returned. |
|
682 """ |
|
683 session = self._get_session(sessionid, setcnxset=False) |
|
684 return session.get_shared_data(key, default, pop, txdata) |
|
685 |
|
686 @deprecated('[3.19] use session or transaction data') |
|
687 def set_shared_data(self, sessionid, key, value, txdata=False): |
|
688 """set value associated to `key` in shared data |
|
689 |
|
690 if `txdata` is true, the value will be added to the repository session's |
|
691 transaction's data which are cleared on commit/rollback of the current |
|
692 transaction. |
|
693 """ |
|
694 session = self._get_session(sessionid, setcnxset=False) |
|
695 session.set_shared_data(key, value, txdata) |
|
696 |
672 |
697 def close(self, sessionid, txid=None, checkshuttingdown=True): |
673 def close(self, sessionid, txid=None, checkshuttingdown=True): |
698 """close the session with the given id""" |
674 """close the session with the given id""" |
699 session = self._get_session(sessionid, txid=txid, |
675 session = self._get_session(sessionid, txid=txid, |
700 checkshuttingdown=checkshuttingdown) |
676 checkshuttingdown=checkshuttingdown) |