[asterisk-bugs] [JIRA] Commented: (ASTERISK-20326) res_odbc blocks datastore while a transaction waits for a lock

Christoph Sitter (JIRA) noreply at issues.asterisk.org
Wed Aug 29 01:56:07 CDT 2012


    [ https://issues.asterisk.org/jira/browse/ASTERISK-20326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196335#comment-196335 ] 

Christoph Sitter commented on ASTERISK-20326:
---------------------------------------------

Hello Matt,

I'm sorry, but I don't agree with what you said.

If I'm using a pool of n connections, and one connection is blocked (waits for a row-level lock on the database to be released), then it must be possible, to request a new connection and execute queries onto different rows.

IF the second connection will operate on the same row, it will have to wait for the database to release the lock. It makes no sense to stop offering connections out of the pool.

Also your argument just works for one Server, as soon as you're using two servers, the concurrency problem occurs again.



> res_odbc blocks datastore while a transaction waits for a lock
> --------------------------------------------------------------
>
>                 Key: ASTERISK-20326
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20326
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_odbc
>    Affects Versions: 10.7.0
>         Environment: RHEL 2.6.32-220.el6.x86_64 GNU/Linux
>            Reporter: Christoph Sitter
>
> I have set up res_odbc to use a pool of 10 connections per resource (oracle 11g connections) and I also wrote a C-Module which uses res_odbc for Oracle connection management.
> What I'm doing:
>   - Start a transaction
>   - select for update (read + lock)
>   - update
>   - commit/rollback
> When I now lock the row that is affected by the transaction from within another session, the "select for update" has to wait until the other session has committed it's work.
> This is an expected behaviour and res_odbc does not produce any errors here.
> The problem is to get a further connection.
> In my case, I want to read a different row from the same table, but ast_odbc_request_obj hangs until the work is committed and the transactional "select for update" stops waiting.
> I tried to find out where exactly the problem is, and I think that it is the following command:
> obj = ao2_callback(class-obj_container, 0, aoro2_obj_cb, EOR_TX); at the beginning of ast_odbc_request_obj_2
> Hopefully this problem can be fixed soon ;)
> best regards
> Christoph

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list