Skip to content

Commit

Permalink
Fixed connection re-opening on-demand.
Browse files Browse the repository at this point in the history
git-svn-id: http://quickbooks.rubyforge.org/svn@18 0eb1a872-461d-0410-a379-984e9e9c21cf
  • Loading branch information
dcparker committed Apr 15, 2008
1 parent f0c64c4 commit a542493
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trunk/lib/quickbooks/adapters/ole_adapter.rb
Expand Up @@ -98,7 +98,7 @@ def session?

# Sends a request to Quickbooks. This request should be a valid QBXML request. Use Qbxml::Request to generate valid requests.
def send_xml(xml)
@quickbooks.ProcessRequest(session, xml)
connection.ProcessRequest(session, xml)
rescue => e
warn "ERROR processing request:\n#{xml}"
raise # Reraises the original error, only this way we got the xml output
Expand Down Expand Up @@ -136,10 +136,10 @@ def end_session
# Close the connection to Quickbooks. Automatically ends the session, if there is one.
def close
end_session
if connected? && connection.CloseConnection
if connected? && connection.CloseConnection.nil?
@connected = false
@connection = nil
Quickbooks::Connection.connections = Quickbooks::Connection.connections - [self]
Connection.connections = Connection.connections - [self]
end
return !@connected # Returns false if CloseConnection failed.
end
Expand Down

0 comments on commit a542493

Please sign in to comment.