Splice - Ruby on Rails

Slice

Overview

For tests are used JRuby 9.1.5.0, Rails 4.2.5.1, and Ruby 2.3.1 (for MySQL)

Action MySQL
Ruby 2.3.1
Derby
JRuby 9.1.5.0
Splice 2 & 3
JRuby 9.1.5.0
Create passed passed passed
Update passed passed passed
Read Only Update passed passed passed
Destroy passed passed passed
Create With passed passed fixed
Note: LIMIT issue

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  companies.* FROM companies WHERE companies.name = ? LIMIT 1
Shared Example Group: "model create_with" called from ./spec/models/company_spec.rb:17
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:33:in `block in (root)'
# ./spec/support/shared_examples/model.rb:33:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Validations passed passed passed
Has Many Association
Add passed passed fixed
Note: ID issue
 Failure/Error: expect(item.send(model_association).count).to eq 1

       expected: 1
            got: 0

       (compared using ==)
     Shared Example Group: "has_many association" called from ./spec/models/company_spec.rb:25
     # ./spec/support/shared_examples/model.rb:113:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `'
Failure/Error: expect(item.send(model_association).count).to eq 1

       expected: 1
            got: 0

       (compared using ==)
     Shared Example Group: "has_many association" called from ./spec/models/company_spec.rb:25
     # ./spec/support/shared_examples/model.rb:113:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `'
Delete passed passed fixed
Note: LIMIT issue
Failure/Error: item.send(model_association).delete(item_associated)

     ActiveRecord::StatementInvalid:
       ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  profiles.* FROM profiles WHERE profiles.user_id = ? LIMIT 1
     Shared Example Group: "has_many association" called from ./spec/models/company_spec.rb:25
     # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
     # ./spec/support/shared_examples/model.rb:119:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Destroy passed passed fixed
Note: LIMIT issue
Failure/Error: item.destroy

     ActiveRecord::StatementInvalid:
       ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  profiles.* FROM profiles WHERE profiles.user_id = ? LIMIT 1
     Shared Example Group: "has_many association" called from ./spec/models/company_spec.rb:25
     # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
     # ./spec/support/shared_examples/model.rb:130:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Has One Association
Add passed passed fixed
Note: LIMIT issue
Failure/Error: item.send("#{model_association}=", item_associated)

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  profiles.* FROM profiles WHERE profiles.user_id = ? LIMIT 1
Shared Example Group: "has_one association" called from ./spec/models/user_spec.rb:20
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:82:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Note: LIMIT issue
Failure/Error: expect(model.where(id: item.id)[0].send(model_association)).to eq item_associated

expected: < Profile id: 223, user_id: 409, profile_name: "userProfile-28", views: 0, created_at: "2016-10-31 12:33:23", updated_at: "2016-10-31 12:33:23">
    got: nil

(compared using ==)
Shared Example Group: "has_one association" called from ./spec/models/user_spec.rb:20
# ./spec/support/shared_examples/model.rb:88:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `'
Belongs To Association
Add passed passed fixed
Note: LIMIT issue
Failure/Error: expect(model.where(id: item.id)[0].send(model_association)).to eq item_associated

ActiveRecord::StatementInvalid:
  ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59.: SELECT  companies.* FROM companies WHERE companies.id = ? LIMIT 1
Shared Example Group: "belongs_to association" called from ./spec/models/user_spec.rb:21
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:63:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Note: LIMIT issue
Failure/Error: expect(model.where(id: item.id)[0].send(model_association)).to eq item_associated

expected: #< Company id: 1062, name: "company-69", created_at: "2016-10-31 12:33:23", updated_at: "2016-10-31 12:33:23", description: "''">
    got: #< Company id: 1061, name: "company-68", created_at: "2016-10-31 12:33:23", updated_at: "2016-10-31 12:33:23", description: "">

(compared using ==)

Diff:

@@ -1,7 +1,7 @@
-#< Company:0x4893a9f0
- id: 1062,
- name: "company-69",
+#< Company:0xae54cb3
+ id: 1061,
+ name: "company-68",
 created_at: Mon, 31 Oct 2016 12:33:23 UTC +00:00,
 updated_at: Mon, 31 Oct 2016 12:33:23 UTC +00:00,
- description: "''">
+ description: "">

Shared Example Group: "belongs_to association" called from ./spec/models/user_spec.rb:21
# ./spec/support/shared_examples/model.rb:63:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `'
AAAA
Polumorfic Association
Add passed passed fixed
Note: LIMIT issue
  Failure/Error: item.send "#{model_association}=", item_associated

     ActiveRecord::StatementInvalid:
       ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 106.: SELECT  addresses.* FROM addresses WHERE addresses.addressable_id = ? AND addresses.addressable_type = ? LIMIT 1
     Shared Example Group: "polymorphic association" called from ./spec/models/company_spec.rb:26
     # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
     # ./spec/support/shared_examples/model.rb:198:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 106. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Has Many Through
Add passed passed passed
Delete passed passed fixed
Note: LIMIT issue
  Failure/Error: item.send(model_through_association_pl).send(:destroy_all)

     ActiveRecord::StatementInvalid:
       ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  profiles.* FROM profiles WHERE profiles.user_id = ? LIMIT 1
     Shared Example Group: "has_many through association" called from ./spec/models/company_spec.rb:27
     # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
     # ./spec/support/shared_examples/model.rb:185:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Has Many And Belongs To
Add passed passed passed
Create passed passed fixed
Note:
Issues:
1. Limit issue
2. Intermediate table tag_users is not automatically populated with relevant fields by Rails
Failure/Error: item.send(model_association).send(:create, item_associated.attributes.except('id', 'created_at', 'updated_at'))

ActiveRecord::StatementInvalid:
  ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59.: SELECT  companies.* FROM companies WHERE companies.id = ? LIMIT 1
Shared Example Group: "habtm association" called from ./spec/models/tag_spec.rb:13
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:152:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Note:
Issues:
1. Intermediate table tag_users is not automatically populated with relevant fields by Rails
Failure/Error: expect(item.send(model_association).count).to eq 1

expected: 1
    got: 0

(compared using ==)
Shared Example Group: "habtm association" called from ./spec/models/profile_spec.rb:5
# ./spec/support/shared_examples/model.rb:153:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `'
Delete passed passed passed
All passed passed passed
All after update passed passed fixed
Note: ID issue
Selecting all the records works as expected, without any modification. When record is updated, the record itself contains the updated values, but when selecting all records from database, it returns values which are the same as before the update for the updated record.
Failure/Error: expect(model.where(id: item_2.id)[0].send(field)).to eq item_2.send(field)

   expected: "New Company"
        got: "company-27"

   (compared using ==)
 Shared Example Group: "selector all with update" called from ./spec/models/company_spec.rb:39
 # ./spec/support/shared_examples/model.rb:282:in `block in (root)'
 # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
 # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
 # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
 # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
 # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
 # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
 # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `'
Order passed passed passed
Reverse Order passed passed passed
Limit passed passed fixed
    Failure/Error: expect(result).to eq return_result

     ActiveRecord::StatementInvalid:
       ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "1" at line 1, column 42.: SELECT  companies.* FROM companies LIMIT 1
     Shared Example Group: "selector" called from ./spec/models/company_spec.rb:34
     # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
     # ./spec/support/shared_examples/model.rb:270:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "1" at line 1, column 42. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Select passed passed passed
Group passed passed passed
Offset passed passed fixed
    Failure/Error: expect(result).to eq return_result

     ActiveRecord::StatementInvalid:
       ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "1" at line 1, column 42.: SELECT companies.* FROM companies OFFSET 1
     Shared Example Group: "selector" called from ./spec/models/company_spec.rb:37
     # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
     # ./spec/support/shared_examples/model.rb:270:in `block in (root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
     # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "1" at line 1, column 42. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Find passed passed fixed
Note: LIMIT issue
Failure/Error: expect(model.send(:find, item_2.id)).to eq item_2

ActiveRecord::StatementInvalid:
  ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59.: SELECT  companies.* FROM companies WHERE companies.id = ? LIMIT 1
Shared Example Group: "find selector" called from ./spec/models/company_spec.rb:41
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:294:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Find By passed passed fixed
Note: LIMIT issue
Failure/Error: expect(model.find_by(field => value1)).to eq(item1)

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  companies.* FROM companies WHERE companies.name = ? LIMIT 1
Shared Example Group: "find_by selector" called from ./spec/models/company_spec.rb:55
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:441:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Find Array passed passed passed
Find in Batches passed passed fixed
Note: LIMIT issue
Failure/Error: model.send(:find_in_batches) do |batch|

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 63.: SELECT  companies.* FROM companies  ORDER BY companies.id ASC LIMIT 1000
Shared Example Group: "find selector" called from ./spec/models/company_spec.rb:41
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:306:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 63. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Join passed passed passed
Include passed passed fixed
Note: LIMIT issue
Failure/Error: expect(item_object.send(model_association).count).to eq 1

expected: 1
got: 0

(compared using ==)
Shared Example Group: "join and include query" called from ./spec/models/company_spec.rb:43
# ./spec/support/shared_examples/model.rb:223:in `block in (root)'
# ./spec/support/shared_examples/model.rb:222:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `'
Distinct passed passed passed
Eager Load passed passed passed
Preload passed passed passed
References passed passed passed
Range passed passed passed
Subset passed passed passed
find_or_create_by
Create passed passed fixed
Note: LIMIT issue
Failure/Error: expect(model.find_or_create_by(field => value).send(field)).to eq(value)

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  companies.* FROM companies WHERE companies.name = ? LIMIT 1
Shared Example Group: "find_or_create_by selector" called from ./spec/models/company_spec.rb:61
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:468:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Find passed passed passed
find_or_create_by!
Create passed passed fixed
Note: LIMIT issue
Failure/Error: expect(model.find_or_create_by!(field => value).send(field)).to eq(value)

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  companies.* FROM companies WHERE companies.name = ? LIMIT 1
Shared Example Group: "find_or_create_by! selector" called from ./spec/models/company_spec.rb:63
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:479:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Find passed passed passed
find_or_initialize_by
Initialize passed passed fixed
Note: LIMIT issue
Failure/Error: expect(model.find_or_initialize_by(field => value).attributes).to eq(model.new(field => value).attributes)

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61.: SELECT  companies.* FROM companies WHERE companies.name = ? LIMIT 1
Shared Example Group: "find_or_initialize_by selector" called from ./spec/models/company_spec.rb:65
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:490:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 61. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Find passed passed passed
Select All passed passed passed
None relation passed passed passed
Pluck passed passed passed
Ids passed passed passed
Exists? passed passed fixed
Note: LIMIT issue
Failure/Error: expect(model.where(field => value).exists?).to eq(true)

ActiveRecord::StatementInvalid:
ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 58.: SELECT  1 AS one FROM companies WHERE companies.name = ? LIMIT 1
Shared Example Group: "exists? selector" called from ./spec/models/company_spec.rb:73
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:530:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 58. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Minimum passed passed passed
Pessimistic Locking (lock) passed passed fixed
Note: Lock issue
Failure/Error: locked_item = model.find(item.id).lock!

ActiveRecord::StatementInvalid:
  ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59.: SELECT  companies.* FROM companies WHERE companies.id = ? LIMIT 1
Shared Example Group: "pessimistic locking" called from ./spec/models/company_spec.rb:79
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:233:in `block in (root)'
# ./spec/support/shared_examples/model.rb:232:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Failure/Error: locked_item = model.find(item.id).lock!

ActiveRecord::StatementInvalid:
 ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: FOR UPDATE is not permitted in this type of statement.  : SELECT COUNT(*) FROM "COMPANIES" WHERE "COMPANIES"."ID" = ? FOR UPDATE
Shared Example Group: "pessimistic locking" called from ./spec/models/company_spec.rb:79
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:233:in `block in (root)'
# ./spec/support/shared_examples/model.rb:232:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: FOR UPDATE is not permitted in this type of statement. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Extend Scope passed passed fixed
Note: LIMIT issue, Offset issue
Failure/Error: expect(scope.page(2).to_a).to eq([item_5, item_6])

ActiveRecord::StatementInvalid:
  ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "4" at line 1, column 42.: SELECT  companies.* FROM companies LIMIT 4 OFFSET 4
Shared Example Group: "extending scope" called from ./spec/models/company_spec.rb:81
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/support/shared_examples/model.rb:382:in `block in (root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "4" at line 1, column 42. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
Average passed passed fixed
Note: LIMIT issue
Failure/Error: instance.save!

ActiveRecord::StatementInvalid:
  ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59.: SELECT  companies.* FROM companies WHERE companies.id = ? LIMIT 1
# arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'
# ./spec/factories/factory_splice_fix.rb:5:in `block in /home/aleksandar/splice-jruby/spec/factories/factory_splice_fix.rb'
# ./.bundle/jruby/2.3.0/gems/factory_girl-4.5.0/lib/factory_girl/evaluation.rb:15:in `create'
# ./.bundle/jruby/2.3.0/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:12:in `block in result'
# ./.bundle/jruby/2.3.0/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:9:in `result'
# ./.bundle/jruby/2.3.0/gems/factory_girl-4.5.0/lib/factory_girl/factory.rb:42:in `run'
# ./.bundle/jruby/2.3.0/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:23:in `block in run'
# ./.bundle/jruby/2.3.0/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:22:in `run'
# ./.bundle/jruby/2.3.0/gems/factory_girl-4.5.0/lib/factory_girl/strategy_syntax_method_registrar.rb:20:in `block in define_singular_strategy_method'
# ./spec/models/company_spec.rb:90:in `block in user1'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
# /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' # /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' # ------------------ # --- Caused by: --- # ActiveRecord::JDBCError: # java.sql.SQLSyntaxErrorException: Syntax error: Encountered "LIMIT" at line 1, column 59. # arjdbc/jdbc/RubyJdbcConnection.java:929:in `execute_query'

Issues

LIMIT issue

Fixed

JDBC adapter for splice reports an error when using LIMIT.
Compared to derby adapter, the LIMIT command is being translated to: FETCH FIRST 1 ROWS ONLY, instead of LIMIT 1

OFFSET issue

Fixed

JDBC adapter for splice reports an error when using OFFSET.
The OFFSET is being called by the adapter like 'OFFSET 4', instead of 'OFFSET 4 ROWS'

ID issue

Fixed

The ID is not properly created. Newly created object returns ID=0 instead of the actual ID.

# /active_record/persistence.rb

def _create_record(attribute_names = self.attribute_names)
  attributes_values = arel_attributes_with_values_for_create(attribute_names)

  new_id = self.class.unscoped.insert attributes_values
  self.id ||= new_id if self.class.primary_key

  @new_record = false
  id
end
        

Has Many and Belongs To issue

Fixed

Rails or the adapter doesn't generate SQL which would populate the rows into 'intermediate' table, e.g. "tags_users" with user_id and tag_id

FOR UPDATE issue (Both Splice and Derby)

Fixed

For locking the tables is used command "FOR UPDATE", which is not supported by Derby.
SELECT COUNT(*) FROM "COMPANIES" WHERE "COMPANIES"."ID" = ? FOR UPDATE

Selecting all after updating a record

Fixed

When selecting all records from database, all records are retreved as expected.
But, once an individual record is updated, selecting all records from a database table that contains the updated record, will return all the records like no previous update was made, even-though when retreving the actual updated record, it will retreve the new updated values.

Extend Scope issue

Fixed
When extending the scope, derby generates:
        SELECT  "COMPANIES".* FROM "COMPANIES" OFFSET 4 ROWS FETCH FIRST 4 ROWS ONLY
        
For splice it generates:
        SELECT  companies.* FROM companies FETCH FIRST 4 ROWS ONLY OFFSET 4 ROWS
        
This is a Rails issue.

Circular dependency issue

Not being able to reproduce anymore
When running a rake task with a number of inputs, an error might occur:
Circular dependency detected while autoloading constant Company



Migration Issues

rake db:migrate issue

Fixed
SQL command generated by Rails:
CREATE TABLE schema_migrations (version varchar(32672) NOT NULL)
          (296.0ms)  CREATE TABLE schema_migrations (version varchar(32672) NOT NULL)
rake aborted!
NoMethodError: undefined method `+' for :version:Symbol
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:969:in `block in quoted_columns_for_index'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:969:in `quoted_columns_for_index'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:941:in `add_index_options'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:556:in `add_index'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/schema_migration.rb:32:in `create_table'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:822:in `initialize_schema_migrations_table'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:925:in `initialize'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:823:in `up'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:801:in `migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:44:in `block in (root)'
      

CREATE TABLE schema_migrations issue

Fixed
SQL command generated by Rails when creating database table:
CREATE TABLE companies (id primary_key, name varchar(32672), created_at timestamp NOT NULL, updated_at timestamp NOT NULL)
 (36.0ms)  CREATE TABLE companies (id primary_key, name varchar(32672), created_at timestamp NOT NULL, updated_at timestamp NOT NULL)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

ActiveRecord::JDBCError: java.sql.SQLSyntaxErrorException: TYPE 'PRIMARY_KEY' does not exist.: CREATE TABLE companies (id primary_key, name varchar(32672), created_at timestamp NOT NULL, updated_at timestamp NOT NULL) arjdbc/jdbc/RubyJdbcConnection.java:587:in `execute'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/adapter.rb:595:in `_execute'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/adapter.rb:571:in `block in execute'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:472:in `block in log'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `log'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/adapter.rb:571:in `execute'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in `create_table'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:665:in `block in method_missing'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in `block in say_with_time'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in `say_with_time'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:654:in `method_missing'
/home/aleksandar/splice-jruby/db/migrate/20161019100128_create_companies.rb:3:in `change'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:608:in `exec_migration'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:592:in `block in migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:591:in `block in migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:590:in `migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:768:in `migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:959:in `block in migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in `migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:823:in `up'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:801:in `migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/home/aleksandar/splice-jruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:44:in `block in (root)'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `block in start'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start'
/home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/bin/jruby_executable_hooks:15:in `
'

Default value for string

Fixed
when setting a default string in migration like:
        t.string :header, default: ''
      
It sets a default value '' (two single quoutes) in the database, instead of an empty string.

Creating indexes freezes the migration

Fixed
When adding an index or a foreign key inside a reference it is causing migration to freeze:
create_join_table :users, :tags do |t|
  t.index [:user_id, :tag_id]
  t.index [:tag_id, :user_id]
end
      
CREATE UNIQUE INDEX "UNIQUE_SCHEMA_MIGRATIONS" ON "SCHEMA_MIGRATIONS" ("VERSION")
      
It translates to the correct SQL command, but the execution freezes the migration

Command rake db:create is not supported

Confirmed. Not supported by Splice nor Derby
java.sql.SQLNonTransientConnectionException: Connection authentication failure occurred.  Reason: userid or password invalid.
arjdbc/jdbc/RubyJdbcConnection.java:463:in `init_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/connection.rb:15:in `initialize'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/adapter.rb:76:in `initialize'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/adapter.rb:44:in `new'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/connection_methods.rb:12:in `jdbc_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/jdbc/connection_methods.rb:20:in `embedded_driver'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-jdbcsplice-adapter-0.1.2/lib/arjdbc/splice/connection_methods.rb:18:in `splice_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/home/aleksandar/.rvm/rubies/jruby-9.1.5.0/lib/ruby/stdlib/monitor.rb:214:in `mon_synchronize'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/home/aleksandar/.rvm/rubies/jruby-9.1.5.0/lib/ruby/stdlib/monitor.rb:214:in `mon_synchronize'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/connection_handling.rb:87:in `connection'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-jdbc-adapter-1.3.21/lib/arjdbc/tasks/derby_database_tasks.rb:9:in `create'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:93:in `create'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:275:in `block in each_current_configuration'
org/jruby/RubyArray.java:1734:in `each'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:274:in `each_current_configuration'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:17:in `block in (root)'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:240:in `block in execute'
org/jruby/RubyArray.java:1734:in `each'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:235:in `execute'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/aleksandar/.rvm/rubies/jruby-9.1.5.0/lib/ruby/stdlib/monitor.rb:214:in `mon_synchronize'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/task.rb:165:in `invoke'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:150:in `invoke_task'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:106:in `block in top_level'
org/jruby/RubyArray.java:1734:in `each'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:106:in `block in top_level'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:115:in `run_with_threads'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:100:in `top_level'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:78:in `block in run'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:176:in `standard_exception_handling'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/lib/rake/application.rb:75:in `run'
/home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/gems/rake-10.5.0/bin/rake:33:in `
' org/jruby/RubyKernel.java:974:in `load' /home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/bin/rake:1:in `
' org/jruby/RubyKernel.java:974:in `load' /home/aleksandar/splice-ruby/.bundle/jruby/2.3.0/bin/rake:22:in `(root)' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:1:in `(root)' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:74:in `kernel_load' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli/exec.rb:27:in `run' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:332:in `exec' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:20:in `dispatch' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `block in start' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/cli.rb:11:in `start' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/exe/bundle:34:in `
' org/jruby/RubyKernel.java:974:in `load' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/gems/bundler-1.13.5/lib/bundler/friendly_errors.rb:100:in `' org/jruby/RubyKernel.java:995:in `eval' /home/aleksandar/.rvm/gems/jruby-9.1.5.0/bin/jruby_executable_hooks:15:in `
' Couldn't create database for {"adapter"=>"jdbcsplice", "username"=>"splice", "password"=>"admin", "prepared_statements"=>true, "pool"=>1000, "server_url"=>"localhost:1527", "database"=>"splicedb_test"}
CREATE UNIQUE INDEX "UNIQUE_SCHEMA_MIGRATIONS" ON "SCHEMA_MIGRATIONS" ("VERSION")
      
It translates to the correct SQL command, but the execution freezes the migration

Splice notes

Creating Indexes

Fixed
When running a command to create index in sqlshell it freezes and never finishes.
CREATE UNIQUE INDEX "UNIQUE_SCHEMA_MIGRATIONS" ON "SCHEMA_MIGRATIONS" ("VERSION")
      
Soution: Make sure there is enough free space on the hard-drive

Creating Foreign Keys

Fixed
When running a command to create foreign key in sqlshell it freezes and never finishes.
ALTER TABLE "SETTINGS" ADD CONSTRAINT "FK_RAILS_5676777BF1" FOREIGN KEY ("USER_ID") REFERENCES "USERS" ("ID")
      
Soution: Make sure there is enough free space on the hard-drive

Create New Database

Currently not supported by Splice
When running a command to create new database in sqlshell:
connect 'jdbc:splice://localhost:1527/splicedb_test;create=true;user=splice;password=admin';
      
It reports an error:
ERROR 08004: Connection authentication failure occurred.  Reason: userid or password invalid.
      


Where the same command when run against Derby database, creates a new database.

For Rails use-case this is important as usually one database is used in development mode, and a different one is used for running tests.

Log Levels

Log levels in Rails are: :debug, :info, :warn, :error, :fatal, and :unknown, corresponding to the log level numbers from 0 up to 5, respectively

Splice gems for Rails

gem 'activerecord-jdbcsplice-adapter'   (gem which should be included in Rails app)
gem 'jdbc-splice'                       (used by the gem above)
      
activerecord-jdbcsplice-adapter
jdbc-splice

Real World Performance

Tests are run on puma server with 16 threads and 1 worker. Pool size is 1000 (except for create where the pool size is 10)

Testing was done using 10.000 requests (1000 requests per 1000 threads in 10.000 requests ) and taken a mean number

Each test for JRuby is run up to 10 times (due to JRuby optimization process)

SPLICE / MYSQL / DERBY

Action ([#/sec]) MySQL
Ruby 2.3.1
Derby
JRuby 9.1.5.0
Splice 2
JRuby 9.1.5.0
Create Create (pool:10, thread 10)
Requests per second 12.72 12.67 26.01
Time taken for tests 785.867 seconds 789.497 seconds 384.461 seconds
Update
Requests per second 12.40 279.10 300.58
Time taken for tests 806.278 seconds 35.830 seconds 33.269 seconds
Where
Requests per second 35.465 399.07 390.25
Time taken for tests 354.655 seconds 25.058 seconds 25.624 seconds
Limit
Requests per second N/A 254.91 259.47
Time taken for tests N/A 39.229 seconds 38.540 seconds

Performance

Performance test compared to MySQL and Derby database for supported queries only.

Samples run 1000 times each.

Action MySQL
Ruby 2.3.1
Derby
JRuby 9.1.5.0
Splice
JRuby 9.1.5.0
Create 0.886047 6.596056 33.390346
Update 6.042646 5.787342 7.722909
Where 0.349582 2.269094 20.273895
Join 0.639624 3.344357 20.823067
Includes 2.156809 6.703227 36.352042
Group 0.312209 1.665367 5.239833
Group & Having 0.285760 1.303565 5.174444
Order 0.642147 1.479684 26.210900
Select 0.582684 1.012709 22.941944

MySQL - RUBY 2.3.1

Samples run 1000 times each.

Action User System Total Real
Create 0.800000 0.020000 0.820000 0.886047
Update 1.270000 0.070000 1.340000 6.042646
Where 0.330000 0.010000 0.340000 0.349582
Join 0.590000 0.030000 0.620000 0.639624
Includes 0.290000 0.010000 0.30000 0.312209
Group 0.290000 0.010000 0.300000 0.312209
Group & Having 0.270000 0.010000 0.280000 0.285760
Order 0.580000 0.030000 0.610000 0.642147
Select 0.540000 0.020000 0.560000 0.582684

SPLICE - JRUBY 9.1.5.0

Samples run 1000 times each.

Action User System Total Real
Create 24.610000 0.270000 24.880000 33.390346
Update 9.850000 0.080000 9.930000 7.722909
Where 8.310000 0.120000 8.430000 20.273895
Join 6.630000 0.100000 6.730000 20.823067
Includes 26.430000 0.180000 26.610000 36.352042
Group 4.950000 0.090000 5.040000 5.239833
Group & Having 3.680000 0.100000 3.780000 5.174444
Order 6.370000 0.080000 6.450000 26.210900
Select 5.470000 0.060000 5.530000 22.941944

Derby - JRUBY 9.1.5.0

Samples run 1000 times each.

Action User System Total Real
Create 19.840000 0.140000 19.980000 6.596056
Update 11.170000 0.070000 11.240000 5.787342
Where 6.960000 0.010000 6.970000 2.269094
Join 9.190000 0.050000 9.240000 3.344357
Includes 16.660000 0.080000 16.740000 6.703227
Group 5.520000 0.010000 5.530000 1.665367
Group & Having 4.060000 0.010000 4.070000 1.303565
Order 3.880000 0.000000 3.880000 1.479684
Select 2.100000 0.010000 2.110000 1.012709