Issue Details (XML | Word | Printable)

Key: ACTIVERECORD_JDBC-133
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Nick Sieger
Reporter: cyberjom
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
activerecord-jdbc

custom sequence_name

Created: 28/Sep/10 08:47 AM   Updated: 26/Aug/11 09:40 PM
Component/s: Oracle
Affects Version/s: 0.9.7
Fix Version/s: None

Time Tracking:
Not Specified

Environment:

os x, jruby 1.5.2 , oracle, active_record 3, arel 1.0.1


Tags:


 Description  « Hide

custom sequence_name specify in model by set_sequence_name show no effect.

it's seem that the caller to insert function of oracle module receive no sequence_name then your code call

default_sequence_name which make id generator can't find sequence and raise err

this behavior occur both 0.9.7 and 1.0.0beta2

Thanks for your help.



Nick Sieger added a comment - 13/Oct/10 09:02 PM

From what I can tell this issue is complicated by the fact that we don't have access to the model metadata down in the insert method in the adapter, and Arel does not pass it along either. It might have to be addressed in ActiveRecord or Arel.

I'd be interested to see what the oracle_enhanced adapter does here.

Your best option for now is to monkeypatch ArJdbc::Oracle#default_sequence_name and put some conditional logic to generate the proper sequences for your application.


joekarl added a comment - 26/Aug/11 09:40 PM

I'm seeing this as well. Has there been any progress on this bug?

See http://stackoverflow.com/questions/7210638/rails-oracle-set-sequence-name-being-ignored

Using jruby 1.6.4, rails 3.0.10, activerecord 3.0.10, activerecord-jdbc-adapter 1.1.3, arel 2.0.10

I tried the monkey patch but I'm pretty sure I've got things in the wrong spot.