Cédric Krier
4b4c57a362
Add duration on Cache
...
issue8249
review283181002
2019-04-11 18:35:25 +02:00
Cédric Krier
cbd72f3003
Clear all reset cache in the Cache commit loop
...
The correct indentation was lost in review68431002 after an update to tip.
issue8027
2019-03-10 19:37:03 +01:00
Cédric Krier
e5e92ac81a
Allow to use channel to synchronize Cache
...
When the clear timeout of the cache is zero, we launch a thread to synchronize
caches if the back-end support channels.
The thread is started on the first call to sync for the database.
The channel is also used to clear the cache of the process initiating the
clearing. This allows to test the mechanism is working with a single process.
So there will be a small delay even on single instance.
issue8027
review68431002
2019-03-09 17:03:38 +01:00
Cédric Krier
c4ddbb064a
Prevent filling cache with data from old transaction
...
Once the cache has been cleared, we must ensure that transaction started
before the clearing cannot fill the global cache.
issue8019
review56541002
2019-03-02 23:11:14 +01:00
Cédric Krier
9eaac0f3a3
Cast timestamp as datetime for sqlite back-end
...
SQLite backend returns a string for the datetime so the comparison between
timestamp fails.
issue8080
review48721002
2019-02-13 10:23:44 +01:00
Cédric Krier
4c7441ec74
Store timestamp on Cache per database
...
The timestamp defines when the cache of a database has been cleared.
issue8018
review50711002
2019-01-30 10:05:55 +01:00
Cédric Krier
572372d3c8
Raise NotImplementedError instead of NotImplemented
...
issue8022
review49731002
2019-01-30 10:00:49 +01:00
Cédric Krier
da24071467
Make Cache transactional
...
We implement sync, commit and rollback to follow transaction semantic.
When a transaction clears a cache, the global cache is cleared only when the
transaction is committed meanwhile the transaction will use a cache for itself
only.
We remove _nocache option because the sync, commit and rollback operate only
for the transaction.
issue7975
review53521002
2019-01-18 11:57:11 +01:00
Cédric Krier
78b2811fff
Prevent Cache to start too much new transactions
...
resets starts a transaction only if there is something to store.
clean is run at best every 5 minutes by default.
issue7533
review64261002
2018-07-10 17:03:49 +02:00
Cédric Krier
d2a461390a
Remove support for Python 2.7
...
issue7497
review53261002
2018-06-26 19:11:19 +02:00
Cédric Krier
d813ac2090
Add limit to SQL queries consumed with a single fetchone call
...
This remove some load on the database server.
This is only needed for queries that may have more than one rows.
issue7040
review43001003
2018-01-09 18:31:00 +01:00
Cédric Krier
cdc5952145
Manage Cache in Transaction
...
issue6216
review33021002
2017-02-02 12:04:27 +01:00
Sergi Almacellas Abellana
0de3ae0a51
Allow to override cache implementation
...
issue5962
review33491003
2016-10-26 15:55:05 +02:00
Cédric Krier
512808e151
Add LRUDictTransaction
...
issue5293
review22771002
2016-03-03 23:27:38 +01:00
Nicolas Évrard
2fef479575
Follow PEP-0249 for Transaction and backends
...
issue4949
review19781002
2016-03-03 21:51:57 +01:00
Cédric Krier
7459aab3d1
Use CURRENT_TIMESTAMP instead of NOW
...
CURRENT_TIMESTAMP is the correct SQL standard way.
issue4837
review15531002
2015-07-01 19:41:49 +02:00
Cédric Krier
34fb7d7471
Drop all cache of a database when it is dropped
...
issue4584
review11121002
2015-03-25 18:56:52 +01:00
Cédric Krier
c144f8c349
Fix most flake8 errors
...
review8771002
2014-12-02 12:54:01 +01:00
Cédric Krier
e0b995abbe
Refactore configuration to allow easy extention
...
issue3627
review7401002
2014-09-03 23:32:01 +02:00
Cédric Krier
bc6acd08ee
Drop support of Python 2.6
...
review2691002
2014-01-31 00:02:03 +01:00
Nicolas Évrard
3215eab818
Cache.set returns the value in order to prevent using temporary variable
...
review543002
2013-09-16 12:29:41 +02:00
Cédric Krier
fc6c6cfdda
Migration to python-sql
...
* Use python-sql
* Add convert_domain method on Fields
* Add sql_format and sql_type methods on Fields
* Allow to return a full domain for Function.searcher
* Replace static backend by dynamic get method
* Replace order_field by order_<field name> method
review1001002
2013-09-06 22:32:37 +02:00
Cédric Krier
1e60085854
Use a better hashing method for context
...
repr doesn't guarantee to have always the same string
review642002
2013-02-04 19:59:05 +01:00
Cédric Krier
d6b453a516
Fix Cache to use the local thread context
2012-12-11 22:57:04 +01:00
Cédric Krier
0fe1b93864
Active Record
2012-09-24 22:16:53 +02:00
Cédric Krier
ee3be37a36
Fix pep8 and pyflakes
2012-04-01 23:08:15 +02:00
Ian Wilson
0226447254
Fix typo.
...
Add missing self paramater.
issue2088
review49010
2011-07-09 18:30:30 -07:00
Cédric Krier
587567077f
Add LRUDict to use as cache
...
issue2033
review31005
2011-06-14 11:44:26 +02:00
Mathias Behrle
5f8b9ca407
Adding missing datetime import.
2010-09-21 12:21:21 +02:00
Cédric Krier
aa5816be0f
Move Cache in trytond.cache and convert outside tools for issue1653
2010-08-24 20:54:27 +02:00