Using odbc, are separate sql_query/2 invocations i

2019-09-09 12:01发布

I know that the ODBC library has a commit/2 and commit/3, but I'm not sure if I am interpreting its use correctly.

If I do the following

  1. create a session with the {auto_commit, off} attribute
  2. and then do a series of separate sql_query/2 SELECT statements (not batched statements, but separate invocations of sql_query/2)
  3. followed by a commit/2

Are the selects all done within a single transaction guaranteeing ACID properties?

标签: erlang odbc
1条回答
闹够了就滚
2楼-- · 2019-09-09 12:06

It seems that unixodbc-oracle driver is buggy, i.e. it doesn't set auto_commit attribute properly during creation of connection. You can apply https://github.com/brb/otp/commit/111f3c091d5f1e9214d2e7cfbd73400b6602a0ed change, which let you to change auto_commit mode after connection is established.

查看更多
登录 后发表回答