fireruby 0.3.0-i586-linux → 0.3.1-i586-linux

Sign up to get free protection for your applications and to get access to all the features.
data/lib/fireruby.so CHANGED
Binary file
data/lib/src.rb CHANGED
@@ -591,7 +591,10 @@ module FireRuby
591
591
 
592
592
  #
593
593
  # This class represents the results of a SQL query executed against a
594
- # database.
594
+ # database. The viable lifespan of a ResultSet object is limited by the
595
+ # transaction that was used in it's creation. Once this transaction has
596
+ # been committed or rolled back all related ResultSet object are invalidated
597
+ # and can no longer be used.
595
598
  #
596
599
  class ResultSet
597
600
  #
@@ -89,4 +89,17 @@ class ConnectionTest < Test::Unit::TestCase
89
89
  end
90
90
  assert(total == 88)
91
91
  end
92
+
93
+ def test04
94
+ connection = @database.connect(DB_USER_NAME, DB_PASSWORD)
95
+
96
+ tx1 = connection.start_transaction
97
+ tx2 = connection.start_transaction
98
+
99
+ connection.close
100
+
101
+ assert(connection.closed?)
102
+ assert(tx1.active? == false)
103
+ assert(tx2.active? == false)
104
+ end
92
105
  end
data/test/DDLTest.rb CHANGED
@@ -26,33 +26,27 @@ class DDLTest < Test::Unit::TestCase
26
26
 
27
27
  def test01
28
28
  @database.connect(DB_USER_NAME, DB_PASSWORD) do |cxn|
29
- begin
30
- cxn.execute_immediate('CREATE TABLE DDL_TABLE_01 (TABLEID '\
31
- 'INTEGER NOT NULL, '\
32
- 'FIELD01 FLOAT, FIELD02 CHAR(50), '\
33
- 'FIELD03 BIGINT, FIELD04 TIMESTAMP '\
34
- 'NOT NULL, FIELD05 VARCHAR(600))')
29
+ cxn.execute_immediate('CREATE TABLE DDL_TABLE_01 (TABLEID '\
30
+ 'INTEGER NOT NULL, '\
31
+ 'FIELD01 FLOAT, FIELD02 CHAR(50), '\
32
+ 'FIELD03 BIGINT, FIELD04 TIMESTAMP '\
33
+ 'NOT NULL, FIELD05 VARCHAR(600))')
35
34
 
36
- cxn.start_transaction do |tx|
37
- r = tx.execute('SELECT COUNT(*) FROM DDL_TABLE_01')
38
- assert(r.fetch[0] == 0)
39
- r.close
40
- end
41
-
42
- cxn.execute_immediate('ALTER TABLE DDL_TABLE_01 ADD PRIMARY KEY '\
43
- '(TABLEID)')
44
-
45
- cxn.execute_immediate('CREATE UNIQUE INDEX DDL_TABLE_IDX ON '\
46
- 'DDL_TABLE_01 (TABLEID)')
47
-
48
- cxn.execute_immediate('DROP INDEX DDL_TABLE_IDX')
49
-
50
- cxn.execute_immediate('DROP TABLE DDL_TABLE_01')
51
- rescue Exception => error
52
- puts error.message
53
- error.backtrace.each {|step| puts " #{step}"}
54
- raise
35
+ cxn.start_transaction do |tx|
36
+ r = tx.execute('SELECT COUNT(*) FROM DDL_TABLE_01')
37
+ assert(r.fetch[0] == 0)
38
+ r.close
55
39
  end
40
+
41
+ cxn.execute_immediate('ALTER TABLE DDL_TABLE_01 ADD PRIMARY KEY '\
42
+ '(TABLEID)')
43
+
44
+ cxn.execute_immediate('CREATE UNIQUE INDEX DDL_TABLE_IDX ON '\
45
+ 'DDL_TABLE_01 (TABLEID)')
46
+
47
+ cxn.execute_immediate('DROP INDEX DDL_TABLE_IDX')
48
+
49
+ cxn.execute_immediate('DROP TABLE DDL_TABLE_01')
56
50
  end
57
51
  end
58
52
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
3
3
  specification_version: 1
4
4
  name: fireruby
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.0
7
- date: 2005-05-23
6
+ version: 0.3.1
7
+ date: 2005-06-07
8
8
  summary: Ruby interface library for the Firebird database.
9
9
  require_paths:
10
10
  - lib