Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

using session.doWork to avoid the use of insane session.connection

  • Loading branch information...
commit 1bd31a44197d8f4283571073f96eef4a6549214b 1 parent 79e1987
@douglasrodrigo douglasrodrigo authored
Showing with 22 additions and 21 deletions.
  1. +7 −6 lib/dm-hibernate-adapter.rb
  2. +15 −15 pom.xml
View
13 lib/dm-hibernate-adapter.rb
@@ -200,12 +200,13 @@ def delete(resources)
def execute_update(sql)
unit_of_work do |session|
- con = session.connection
- st = con.create_statement
- begin
- st.execute_update(sql)
- ensure
- st.close
+ session.do_work do |connection|
+ st = connection.create_statement
+ begin
+ st.execute_update(sql)
+ ensure
+ st.close
+ end
end
end
end
View
30 pom.xml
@@ -12,15 +12,15 @@
<email>m.kristian@web.de</email>
</developer>
<developer>
- <id>pietia_dot_moo_at_gmail_dot_com</id>
- <name>Piotr Gęga</name>
- <email>pietia.moo@gmail.com</email>
- </developer>
- <developer>
<id>douglasrodrigo_at_gmail_dot_com</id>
<name>Douglas Ferreira</name>
<email>douglasrodrigo@gmail.com</email>
</developer>
+ <developer>
+ <id>pietia_dot_moo_at_gmail_dot_com</id>
+ <name>Piotr Gęga</name>
+ <email>pietia.moo@gmail.com</email>
+ </developer>
</developers>
<repositories>
<repository>
@@ -29,7 +29,7 @@
</repository>
<repository>
<id>rubygems-releases</id>
- <url>http://gems.saumya.de/releases</url>
+ <url>http://rubygems-proxy.torquebox.org/releases</url>
</repository>
</repositories>
<dependencies>
@@ -181,7 +181,7 @@
<gem.home>${project.build.directory}/rubygems</gem.home>
<gem.path>${project.build.directory}/rubygems</gem.path>
<jruby.jvmargs>-Xmx1024m</jruby.jvmargs>
- <jruby.plugins.version>0.28.3</jruby.plugins.version>
+ <jruby.plugins.version>0.28.4</jruby.plugins.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
@@ -193,11 +193,11 @@
<version>${jruby.plugins.version}</version>
<extensions>true</extensions>
<configuration>
- <files>lib/dm-hibernate-adapter.rb,lib/dm-hibernate-adapter,lib/dm-hibernate-adapter/dialects.rb,lib/dm-hibernate-adapter/hibernate.rb,lib/dm-hibernate-adapter/spec,lib/dm-hibernate-adapter/transaction.rb,lib/dm-hibernate-adapter/spec/setup.rb,spec/abstract_adapter,spec/dm_core,spec/log4j.properties,spec/transient,spec/abstract_adapter/adapter_shared_spec.rb,spec/abstract_adapter/dm-hibernate-adapter_spec.rb,spec/abstract_adapter/rcov.opts,spec/abstract_adapter/spec.opts,spec/abstract_adapter/spec_helper.rb,spec/dm_core/adapter_spec.rb,spec/dm_core/db,spec/dm_core/rcov.opts,spec/dm_core/spec.opts,spec/dm_core/spec_helper.rb,spec/transient/dm-hibernate-adapter_spec.rb,spec/transient/lib,spec/transient/rcov.opts,spec/transient/shared,spec/transient/spec.opts,spec/transient/spec_helper.rb,spec/transient/lib/adapter_helpers.rb,spec/transient/lib/collection_helpers.rb,spec/transient/lib/counter_adapter.rb,spec/transient/lib/pending_helpers.rb,spec/transient/lib/rspec_immediate_feedback_formatter.rb,spec/transient/shared/adapter_shared_spec.rb,spec/transient/shared/finder_shared_spec.rb,spec/transient/shared/model_spec.rb,spec/transient/shared/property_spec.rb,spec/transient/shared/resource_shared_spec.rb,spec/transient/shared/resource_spec.rb,spec/transient/shared/sel_shared_spec.rb</files>
+ <files>lib/dm-hibernate-adapter.rb,lib/dm-hibernate-adapter,lib/dm-hibernate-adapter/hibernate.rb,lib/dm-hibernate-adapter/spec,lib/dm-hibernate-adapter/spec/setup.rb,lib/dm-hibernate-adapter/spec/setup.rb.~master~,lib/dm-hibernate-adapter/spec/setup.rb.~d2393c0d5057a157181e090262c84e219ccf23eb~,lib/dm-hibernate-adapter/dialects.rb,lib/dm-hibernate-adapter/transaction.rb,spec/transient,spec/transient/spec_helper.rb,spec/transient/dm-hibernate-adapter_spec.rb,spec/transient/rcov.opts,spec/transient/shared,spec/transient/shared/model_spec.rb,spec/transient/shared/adapter_shared_spec.rb,spec/transient/shared/resource_spec.rb,spec/transient/shared/finder_shared_spec.rb,spec/transient/shared/resource_shared_spec.rb,spec/transient/shared/sel_shared_spec.rb,spec/transient/shared/property_spec.rb,spec/transient/lib,spec/transient/lib/counter_adapter.rb,spec/transient/lib/rspec_immediate_feedback_formatter.rb,spec/transient/lib/pending_helpers.rb,spec/transient/lib/collection_helpers.rb,spec/transient/lib/adapter_helpers.rb,spec/transient/spec.opts,spec/log4j.properties,spec/abstract_adapter,spec/abstract_adapter/spec_helper.rb,spec/abstract_adapter/dm-hibernate-adapter_spec.rb,spec/abstract_adapter/rcov.opts,spec/abstract_adapter/adapter_shared_spec.rb,spec/abstract_adapter/spec.opts,spec/dm_core,spec/dm_core/spec_helper.rb,spec/dm_core/rcov.opts,spec/dm_core/spec_helper.rb.~f32a364af03e64dfa8a2280242edb568c9d246c0~,spec/dm_core/spec.opts,spec/dm_core/adapter_spec.rb</files>
<includeOpenSSL>false</includeOpenSSL>
<platform>java</platform>
<requiredRubygemsVersion><![CDATA[> 1.3.1]]></requiredRubygemsVersion>
- <testFiles>spec/abstract_adapter/adapter_shared_spec.rb,spec/abstract_adapter/dm-hibernate-adapter_spec.rb,spec/dm_core/adapter_spec.rb,spec/transient/dm-hibernate-adapter_spec.rb,spec/transient/shared/adapter_shared_spec.rb,spec/transient/shared/finder_shared_spec.rb,spec/transient/shared/model_spec.rb,spec/transient/shared/property_spec.rb,spec/transient/shared/resource_shared_spec.rb,spec/transient/shared/resource_spec.rb,spec/transient/shared/sel_shared_spec.rb</testFiles>
+ <testFiles>spec/transient/dm-hibernate-adapter_spec.rb,spec/transient/shared/model_spec.rb,spec/transient/shared/adapter_shared_spec.rb,spec/transient/shared/resource_spec.rb,spec/transient/shared/finder_shared_spec.rb,spec/transient/shared/resource_shared_spec.rb,spec/transient/shared/sel_shared_spec.rb,spec/transient/shared/property_spec.rb,spec/abstract_adapter/dm-hibernate-adapter_spec.rb,spec/abstract_adapter/adapter_shared_spec.rb,spec/dm_core/adapter_spec.rb</testFiles>
</configuration>
<executions>
<execution>
@@ -229,42 +229,42 @@
</build>
<profiles>
<profile>
- <id>transient</id>
+ <id>dm</id>
<build>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>rspec-maven-plugin</artifactId>
<configuration>
- <specSourceDirectory>spec/transient</specSourceDirectory>
+ <specSourceDirectory>spec/dm_core</specSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
- <id>adapter</id>
+ <id>transient</id>
<build>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>rspec-maven-plugin</artifactId>
<configuration>
- <specSourceDirectory>spec/abstract_adapter</specSourceDirectory>
+ <specSourceDirectory>spec/transient</specSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
- <id>dm</id>
+ <id>adapter</id>
<build>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>rspec-maven-plugin</artifactId>
<configuration>
- <specSourceDirectory>spec/dm_core</specSourceDirectory>
+ <specSourceDirectory>spec/abstract_adapter</specSourceDirectory>
</configuration>
</plugin>
</plugins>
Please sign in to comment.
Something went wrong with that request. Please try again.