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
Cannot open readOnly and readWrite connection on the same database directory #3295
Comments
We use
|
This should be expected. The way to share the same Kuzu database among multiple processes is to open the database under We should prevent concurrent read and write access to the same kuzu database from different processes, as there is no guarantee we can provide to make sure that read and write transactions from different processes are consistent. So I would suggest we don't change this behaviour. but we should document this more clearly in our docs for sure. |
To clarify and make sure I got this correctly: It is expected behavior that access from multiple (ro+rw) import tempfile
import kuzu
with tempfile.TemporaryDirectory() as d:
conn_rw = kuzu.Connection(kuzu.Database(d))
conn_ro = kuzu.Connection(kuzu.Database(d, read_only=True))
conn_rw.execute("CREATE NODE TABLE V(id STRING,PRIMARY KEY(id));")
conn_rw.execute("CREATE (v:V {id: 'foo'}) RETURN v;")
print((conn_rw.execute("MATCH (v:V {id: 'foo'}) RETURN v;").get_next()[0]))
# {'_id': {'offset': 0, 'table': 0}, '_label': 'V', 'id': 'foo'}
print((conn_ro.execute("MATCH (v:V {id: 'foo'}) RETURN v;").get_next()[0]))
# RuntimeError: Binder exception: Table V does not exist. I think it makes sense to provide an appropriate error here as well. |
hi @sapalli2989 , yes. you're right. and we should error on this too. also related to #3292. |
Adding question from Discord for context:
The text was updated successfully, but these errors were encountered: