Jeremy, thanks for the advice. I've switched the hashes to use symbols,
but now I get a different error.
If :server1 is the default then I can run the following with no errors and
get the correct result.
STUDY_DB.with_server(:server1) do
STUDY_DB.synchronize do
StudyUser.all
end
end
However if I then try to switch to use the other connection for :server2
like the below example then I will get the following error.
Sequel::DatabaseConnectionError: OCIError: ORA-01017: invalid
username/password; logon denied
from oci8.c:552:in oci8lib_210.bundle
STUDY_DB.with_server(:server2) do
STUDY_DB.synchronize do
StudyUser.all
end
end
Curiously if I switch the default connection to :server2, then :server2
works correctly and :server1 throws the error when used in a `with_server`
block.
On Monday, June 16, 2014 11:38:44 AM UTC-4, Jeremy Evans wrote:
>
> On Monday, June 16, 2014 8:30:31 AM UTC-7, Caleb Woods wrote:
>>
>> I'm trying to use the DB Sharding features of Sequel described on the
>> sharding page
>> http://sequel.jeremyevans.net/rdoc/files/doc/sharding_rdoc.html.
>> Specifically I'm trying use the `with_server` block so that I can switch
>> connections inside a block.
>>
>> Here is my connection setup
>>
>> servers = {
>> "server1"=> {
>> "adapter"=>"oracle",
>> "database"=>"db1",
>> "username"=>"user1",
>> "password"=>"password2"},
>> "server2"=> {
>> "adapter"=>"oracle",
>> "database"=>"db2",
>> "username"=>"user2",
>> "password"=>"password2"
>> }
>> }
>>
>
> The keys for this hash and subhashes should be symbols, not strings.
>
> Also, there is no point in including :adapter as a key, since you can't
> use a different adapter when sharding.
>
> Please try fixing that first, and if you still have problems, report back.
>
> Thanks,
> Jeremy
>
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.