Class: Db2Session::Connection

Inherits:
Db2Query::Connection
  • Object
show all
Defined in:
lib/db2_session/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, userid, password) ⇒ Connection

Returns a new instance of Connection.



7
8
9
10
11
12
13
14
# File 'lib/db2_session/connection.rb', line 7

def initialize(config, userid, password)
  super(config)
  @userid = userid
  singleton_class.define_method(:new_dbclient) do
    DbClient.new(config, userid, password)
  end
  verify_db_connection
end

Instance Attribute Details

#trx_timeObject

Returns the value of attribute trx_time.



5
6
7
# File 'lib/db2_session/connection.rb', line 5

def trx_time
  @trx_time
end

#useridObject

Returns the value of attribute userid.



5
6
7
# File 'lib/db2_session/connection.rb', line 5

def userid
  @userid
end

Instance Method Details

#create_connection_poolObject



16
17
18
19
20
21
# File 'lib/db2_session/connection.rb', line 16

def create_connection_pool
  synchronize do
    return @connection_pool if @connection_pool
    @connection_pool = Pool.new(pool_config) { new_dbclient }
  end
end