Class: Db2Session::Connection
- Inherits:
-
Db2Query::Connection
- Object
- Db2Query::Connection
- Db2Session::Connection
- Defined in:
- lib/db2_session/connection.rb
Instance Attribute Summary collapse
-
#trx_time ⇒ Object
Returns the value of attribute trx_time.
-
#userid ⇒ Object
Returns the value of attribute userid.
Instance Method Summary collapse
- #create_connection_pool ⇒ Object
-
#initialize(config, userid, password) ⇒ Connection
constructor
A new instance of Connection.
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_time ⇒ Object
Returns the value of attribute trx_time.
5 6 7 |
# File 'lib/db2_session/connection.rb', line 5 def trx_time @trx_time end |
#userid ⇒ Object
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_pool ⇒ Object
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 |