annotate roundup/backends/sessions_rdbms.py @ 6803:db437dd13ed5

set method doesn't include user set timestamp if update set() is supposed to update the record with the key if it already exists. It does update the value marshalled data blob. However it doesn't update the timestamp column for rdbms tables if provided. This change updates the x_time column with the provided __timestamp or preserves the original timestamp.
author John Rouillard <rouilj@ieee.org>
date Mon, 25 Jul 2022 15:07:32 -0400
parents 883c9e90b403
children 375d40a9e730
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
1 """This module defines a very basic store that's used by the CGI interface
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
2 to store session and one-time-key information.
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
3
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
4 Yes, it's called "sessions" - because originally it only defined a session
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
5 class. It's now also used for One Time Key handling too.
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
6 """
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
7 __docformat__ = 'restructuredtext'
5319
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
8 import os, time, logging
5806
abee2c2c822e More cgi.escape/html.escape fixes.
John Rouillard <rouilj@ieee.org>
parents: 5319
diff changeset
9
5837
883c9e90b403 Fix problem with cgi.escape being depricated a different way. This way
John Rouillard <rouilj@ieee.org>
parents: 5806
diff changeset
10 from roundup.anypy.html import html_escape as escape
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
11
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
12 class BasicDatabase:
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
13 ''' Provide a nice encapsulation of an RDBMS table.
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
14
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
15 Keys are id strings, values are automatically marshalled data.
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
16 '''
5252
0b154486ed38 Make sure that the name property is initialized to none.
John Rouillard <rouilj@ieee.org>
parents: 5213
diff changeset
17 name = None
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
18 def __init__(self, db):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
19 self.db = db
5319
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
20 self.conn, self.cursor = self.db.sql_open_connection()
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
21
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
22 def clear(self):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
23 self.cursor.execute('delete from %ss'%self.name)
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
24
2169
12cd4fa91eb7 OTK generation was busted (thanks Stuart D. Gathman)
Richard Jones <richard@users.sourceforge.net>
parents: 2082
diff changeset
25 def exists(self, infoid):
12cd4fa91eb7 OTK generation was busted (thanks Stuart D. Gathman)
Richard Jones <richard@users.sourceforge.net>
parents: 2082
diff changeset
26 n = self.name
12cd4fa91eb7 OTK generation was busted (thanks Stuart D. Gathman)
Richard Jones <richard@users.sourceforge.net>
parents: 2082
diff changeset
27 self.cursor.execute('select count(*) from %ss where %s_key=%s'%(n,
12cd4fa91eb7 OTK generation was busted (thanks Stuart D. Gathman)
Richard Jones <richard@users.sourceforge.net>
parents: 2082
diff changeset
28 n, self.db.arg), (infoid,))
2244
ac4f295499a4 fixed journal marshalling in RDBMS backends [SF#943627]
Richard Jones <richard@users.sourceforge.net>
parents: 2169
diff changeset
29 return int(self.cursor.fetchone()[0])
2169
12cd4fa91eb7 OTK generation was busted (thanks Stuart D. Gathman)
Richard Jones <richard@users.sourceforge.net>
parents: 2082
diff changeset
30
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
31 _marker = []
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
32 def get(self, infoid, value, default=_marker):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
33 n = self.name
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
34 self.cursor.execute('select %s_value from %ss where %s_key=%s'%(n,
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
35 n, n, self.db.arg), (infoid,))
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
36 res = self.cursor.fetchone()
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
37 if not res:
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
38 if default != self._marker:
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
39 return default
4585
033a550812fc Fix another XSS with the "otk" parameter.
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
40 raise KeyError('No such %s "%s"'%(self.name, escape(infoid)))
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
41 values = eval(res[0])
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
42 return values.get(value, None)
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
43
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
44 def getall(self, infoid):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
45 n = self.name
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
46 self.cursor.execute('select %s_value from %ss where %s_key=%s'%(n,
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
47 n, n, self.db.arg), (infoid,))
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
48 res = self.cursor.fetchone()
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
49 if not res:
4585
033a550812fc Fix another XSS with the "otk" parameter.
Ralf Schlatterbeck <rsc@runtux.com>
parents: 4570
diff changeset
50 raise KeyError('No such %s "%s"'%(self.name, escape (infoid)))
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
51 return eval(res[0])
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
52
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
53 def set(self, infoid, **newvalues):
5213
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
54 """ Store all newvalues under key infoid with a timestamp in database.
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
55
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
56 If newvalues['__timestamp'] exists and is representable as a floating point number
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
57 (i.e. could be generated by time.time()), that value is used for the <name>_time
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
58 column in the database.
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
59 """
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
60 c = self.cursor
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
61 n = self.name
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
62 a = self.db.arg
6803
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
63 c.execute('select %s_value, %s_time from %ss where %s_key=%s'% \
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
64 (n, n, n, n, a),
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
65 (infoid,))
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
66 res = c.fetchone()
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
67 if res:
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
68 values = eval(res[0])
6803
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
69 timestamp = res[1]
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
70 else:
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
71 values = {}
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
72 values.update(newvalues)
6803
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
73 if res:
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
74 if '__timestamp' in newvalues:
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
75 try:
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
76 # __timestamp must be representable as a float. Check it.
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
77 timestamp = float(newvalues['__timestamp'])
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
78 except ValueError:
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
79 pass
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
80
6803
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
81 sql = ('update %ss set %s_value=%s, %s_time=%s '
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
82 'where %s_key=%s'%(n, n, a, n, a, n, a))
db437dd13ed5 set method doesn't include user set timestamp if update
John Rouillard <rouilj@ieee.org>
parents: 5837
diff changeset
83 args = (repr(values), timestamp, infoid)
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
84 else:
5213
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
85 if '__timestamp' in newvalues:
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
86 try:
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
87 # __timestamp must be represntable as a float. Check it.
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
88 timestamp = float(newvalues['__timestamp'])
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
89 except ValueError:
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
90 timestamp = time.time()
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
91 else:
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
92 timestamp = time.time()
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
93
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
94 sql = 'insert into %ss (%s_key, %s_time, %s_value) '\
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
95 'values (%s, %s, %s)'%(n, n, n, n, a, a, a)
5213
bf13b28156f3 This change didn't make it into the last commit. Allow the user to
John Rouillard <rouilj@ieee.org>
parents: 4585
diff changeset
96 args = (infoid, timestamp, repr(values))
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
97 c.execute(sql, args)
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
98
4390
936bd9bf732d session API consistency
Richard Jones <richard@users.sourceforge.net>
parents: 4362
diff changeset
99 def list(self):
936bd9bf732d session API consistency
Richard Jones <richard@users.sourceforge.net>
parents: 4362
diff changeset
100 c = self.cursor
936bd9bf732d session API consistency
Richard Jones <richard@users.sourceforge.net>
parents: 4362
diff changeset
101 n = self.name
936bd9bf732d session API consistency
Richard Jones <richard@users.sourceforge.net>
parents: 4362
diff changeset
102 c.execute('select %s_key from %ss'%(n, n))
936bd9bf732d session API consistency
Richard Jones <richard@users.sourceforge.net>
parents: 4362
diff changeset
103 return [res[0] for res in c.fetchall()]
936bd9bf732d session API consistency
Richard Jones <richard@users.sourceforge.net>
parents: 4362
diff changeset
104
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
105 def destroy(self, infoid):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
106 self.cursor.execute('delete from %ss where %s_key=%s'%(self.name,
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
107 self.name, self.db.arg), (infoid,))
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
108
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
109 def updateTimestamp(self, infoid):
3848
7ad206564007 Use """ instead of ''' in comments, or emacs python-mode bails out.
Erik Forsberg <forsberg@users.sourceforge.net>
parents: 3606
diff changeset
110 """ don't update every hit - once a minute should be OK """
3606
04dc3eef67b7 reduced frequency of session timestamp update
Richard Jones <richard@users.sourceforge.net>
parents: 2244
diff changeset
111 now = time.time()
04dc3eef67b7 reduced frequency of session timestamp update
Richard Jones <richard@users.sourceforge.net>
parents: 2244
diff changeset
112 self.cursor.execute('''update %ss set %s_time=%s where %s_key=%s
04dc3eef67b7 reduced frequency of session timestamp update
Richard Jones <richard@users.sourceforge.net>
parents: 2244
diff changeset
113 and %s_time < %s'''%(self.name, self.name, self.db.arg,
04dc3eef67b7 reduced frequency of session timestamp update
Richard Jones <richard@users.sourceforge.net>
parents: 2244
diff changeset
114 self.name, self.db.arg, self.name, self.db.arg),
04dc3eef67b7 reduced frequency of session timestamp update
Richard Jones <richard@users.sourceforge.net>
parents: 2244
diff changeset
115 (now, infoid, now-60))
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
116
3989
0112e9e1d068 improvements to session management
Richard Jones <richard@users.sourceforge.net>
parents: 3920
diff changeset
117 def clean(self):
0112e9e1d068 improvements to session management
Richard Jones <richard@users.sourceforge.net>
parents: 3920
diff changeset
118 ''' Remove session records that haven't been used for a week. '''
0112e9e1d068 improvements to session management
Richard Jones <richard@users.sourceforge.net>
parents: 3920
diff changeset
119 now = time.time()
0112e9e1d068 improvements to session management
Richard Jones <richard@users.sourceforge.net>
parents: 3920
diff changeset
120 week = 60*60*24*7
0112e9e1d068 improvements to session management
Richard Jones <richard@users.sourceforge.net>
parents: 3920
diff changeset
121 old = now - week
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
122 self.cursor.execute('delete from %ss where %s_time < %s'%(self.name,
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
123 self.name, self.db.arg), (old, ))
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
124
5319
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
125 def commit(self):
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
126 logger = logging.getLogger('roundup.hyperdb.backend')
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
127 logger.info('commit %s' % self.name)
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
128 self.conn.commit()
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
129 self.cursor = self.conn.cursor()
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
130
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
131 def close(self):
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
132 self.conn.close()
62de601bdf6f Fix commits although a Reject exception is raised
Ralf Schlatterbeck <rsc@runtux.com>
parents: 5252
diff changeset
133
2082
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
134 class Sessions(BasicDatabase):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
135 name = 'session'
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
136
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
137 class OneTimeKeys(BasicDatabase):
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
138 name = 'otk'
c091cacdc505 Finished implementation of session and one-time-key stores for RDBMS backends.
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
139
3920
416606b09b27 fix vim modelines
Justus Pendleton <jpend@users.sourceforge.net>
parents: 3918
diff changeset
140 # vim: set et sts=4 sw=4 :

Roundup Issue Tracker: http://roundup-tracker.org/