-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken .with_transaction_options
and .with_retry_options
on AsyncIOPool
#185
Comments
any updates on the issue? |
cc @tailhook Not yet; we'll take a look soon. |
Hey guys! This bug becomes very annoying, since there is no way to change transaction isolation level on the pool. This is a real bummer, since in the latest EdgeDB SERIALIZABLE is now a default isolation level. Here is how you can reproduce the bug: import edgedb
from edgedb import TransactionOptions, IsolationLevel
async with edgedb.create_async_pool(...) as pool:
mpool = pool.with_transaction_options(TransactionOptions(isolation=IsolationLevel.RepeatableRead)) Please, can you at least help me to figure out how can I change the transaction isolation level for every I'm on the latest edgedb and edgedb-python (both built from source from master). |
.with_transaction_options
and .with_retry_options
on AsyncIOPool
Oh I see. Because of geldata/gel#2877, isolation level set by |
Sorry for long delay. Somehow this slipped from my attention. Fixed setting options in #237. But yes, we are reconsidering transaction isolation. What's your use case of |
I actually do need it for performance reasons. I have a tree-like model with materialized path:
And I need to restore all missing parents on a large number of records. Now, I'm doing something like this: query = """
UPDATE
File
FILTER
.path LIKE <str>$parent_path ++ '/%'
AND
.path NOT LIKE <str>$parent_path ++ '/%/%'
SET {
parent := (
SELECT
File
FILTER
.path = <str>$parent_path
LIMIT 1
)
}
"""
coros = (
pool.query(query, parent_path=parent_path)
for parent_path in parents
)
await asyncio.gather(*coros) With SERIALIZABLE level I get:
|
Have you tried wrap |
Yes, I've tried wrapping it in I don't think |
What did your |
(And it worked when we were using repeatable read?) |
I'm sorry, I oversimplified my example a little bit. In real life I'm using
I prepared a gist with my example: https://gist.github.com/unmade/135cb59092202750b953b3285cc6851d
Yes, the example from gist works with no problem when isolation level is |
I'm on the latest edgedb-python (0.14.0) with EdgeDB 1-beta2 running in Docker
I've tried to call
with_retry_options
method onAsyncIOPool
instance, but it fails with:I've also noticed that AsyncIOPool doesn't implement
_shallow_clone
required by_OptionsMixin
.Also, is there is any specific reason why
_OptionsMixin
doesn't inherit fromabc.ABC
but still usesabstractmethod
decorator?The text was updated successfully, but these errors were encountered: