开发者

Ruby OCI8 not logging off connection consequences

What are the consequences, (if any) not calling the conn.logoff() method after the following script when connect开发者_开发知识库ing to an Oracle database using the Ruby OCI8 library.

conn = OCI8.new('scott', 'tiger')
 num_rows = conn.exec('SELECT * FROM emp') do |r|
   puts r.join(',')
 end
 puts num_rows.to_s + ' rows were processed.'

The reason I'm asking because we're experiencing slow downs with other applications that connect to this same Oracle db.

Thanks


I would imagine that when the Ruby process exits, the session will be killed automatically.

You could check by querying v$session to see if the ruby process is still connected to Oracle after Ruby exits.

Given only the information in your question, its really impossible to say what could be causing slowdowns - there are so many variable.


If you don't call conn.logoff(), the connection is alive even though it is garbage-collected until the ruby process exits. The problem is fixed in ruby-oci8 2.1, which have not been released yet though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜