similar to: Helps!!!!! Rails database connection guru needed!!!!!!!

Displaying 20 results from an estimated 600 matches similar to: "Helps!!!!! Rails database connection guru needed!!!!!!!"

2006 Aug 13
1
establish_connection method
I''m digging into rails source code. But I''ve got a problem in undestading actionrecord::base source code which is connection_specification.rb. In the body of establish_connection method, def self.establish_connection(spec = nil) case spec when nil raise AdapterNotSpecified unless defined? RAILS_ENV establish_connection(RAILS_ENV)
2006 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
Skipped content of type multipart/alternative-------------- next part -------------- Index: connection_adapters/abstract/connection_specification.rb =================================================================== --- connection_adapters/abstract/connection_specification.rb (revision 4617) +++ connection_adapters/abstract/connection_specification.rb (working copy) @@ -1,10 +1,21 @@ require
2006 Jan 26
0
If you want to disconnect a database properly, there is the code:)!!!
Hi, We have worked on a problem of connection: Connect to two databases with a single ActiveRecord::Base model class within the same action The main difficulty is how to disconnect the actual connection properly and then let the ActiveRecord establishes a new one. The actual function "remove_connection" removes the connection, but its doesn''t unbind the link between rails and
2006 Jan 05
7
HOWTO: Combine fields from 2 two tables in 1 object
Hi all, For a dropdownlist (showing "Company - FirstName Lastname'') I want to fill an object @project_contacts with "Name" from table Companies and "Firstname" and "Lastname" from table contacts. Any idea? Regards, Gerard. -- "Who cares if it doesn''t do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS
2007 Jan 11
12
Rails not properly handling Oracle db connections/sesions in dev mode
We are running edge rails with oracle. After a few hundred requests all available sesions are used up. It seems prior connections are being left open. When this happens no one using the installation of Oracle can create a new session until you kill your mongrel/webrick server. Patch #6928 addresses this problem, and i applied it to my vendor rails and it worked. I think, if possible, this
2006 Jan 25
9
connection_specification and adapter
Hi, I wish to know, how those class work exactly, where can I find the documentation? or can someone explain to me how a connection is made via those class??? Thanks you very much!!!! Saiho __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
2006 May 10
8
dynamic setting of username and password in database.yml
Hello I''ve now read a lot about application-level authentication in Rails, but I need to do database-level authentication. The reason is that my database needs to have the current_user (database current_user, not current_user defined in an ActiveRecord Model) set to execute triggers for automatically updating audit tables. So it is not enough to have a session check against a User
2006 Jan 24
3
what this line means exactly? (@@active_connections ||= {})
Hi, I have problem to understand this line does exactly? this is from the class ConnectionSpecficication, methode "active_connections" def self.active_connections #:nodoc: if allow_concurrency Thread.current[''active_connections''] ||= {} else @@active_connections ||= {} end end what the line "@@active_connections ||= {}" means exactly? as I
2006 Jan 13
1
How to disconnect to a database????
Hi, We have experienced some problems with ActiveRecord::Base class of Ruby-Rails. We are building a web-application based on the Ruby-rails framework and the web-application needs to access to difference databases, so we do not pre-define our database accesses in the database.yml file. In fact, we are using the ActiveRecord::Base.establish_connection() to connect to our database, the function
2006 Mar 08
4
unless connected? + multiple databases
Hello all. I am still having fun with multiple databases. In this case it is the unless connected? statement. ActiveRecord::Base establishes a connection that is inherited by the majority of my models. However one Model (Componentlog) that uses a separate DB is coded as: unless Componentlog.connected? establish_connection( :adapter => "oci", :database =>
2005 Dec 30
0
Changing the current connection for Active Record
Hi Everyone, I''ve just updated my Rails install to 1.0 and have noticed that the ActiveRecord connection handling is somewhat different. I''ll explain... I''ve declared a block handler that will change the connection for ActiveRecord::Base prior to yielding to the block, then restore the original connection (see code snippet below). I''m doing this in order to
2005 Sep 29
2
[BUG] Quick Fix for SCGI leaked DB connections
Hi Folks, I believe I tracked down the problem with the leaked DB connections. The simple fix is to put: ActiveRecord::Base.threaded_connections = false In your environment.rb file right before environment.rb does any ActiveRecord use. For example, here''s mine: ActiveRecord::Base.threaded_connections = false ActiveRecord::Base.configurations =
2008 Apr 11
1
database adaptor password in production.log
So, as I''m working on migrating my app from Rails 1.2.1 to Rails 1.2.6, suddenly my database adaptor password is showing up in production log on startup. This could be because use " ActiveRecord::Base.allow_concurrency = true" (I know, nobody else does and you''ll tell me not to do it. But I''ve investigated it and it''s working for me, that''s
2006 Feb 28
1
SQLite database filename?
I''d need to be able to figure out the filename of the SQLite backend of this application (for backups). Does Rails provide API to access the database configuration? Or do I need to load db/database.yml and check for ENV["RAILS_ENV"]? A simple inspection of the ActiveRecord::Base.connection object sheds no light, the @filename attribute is there but instance_methods
2012 Jul 17
6
Database connection parameters are tied to the filesystem
HI Guys, I recently tried VERY hard to override the database configuration bassed on ENV vars or actual API calls. This task is almost next to impossible. I know that the database.yml file is parsed as ERB but that is sane for simple ENV replacement if you want to actually change which database adaptor it is (requires extra config/params) it becomes messy. I found
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2006 Jan 19
4
multiple database in the same actions?
Hi, I read the example in http://wiki.rubyonrails.com/rails/pages/HowtoUseMultipleDatabases, it show us how to connect to other database, each time we start a new action, however, this doesn''t work while you try to connect to two different database within the same action. SO I wonder is it possible to bind to two or more database within the same action???? Thanks you very much Saiho
2006 Jul 20
1
guru needed: connecting to a second (remote) db that may not be available
hi, My rails app connects to 2 databases a local one and a remote one. No problems there.. The problem is that the remote database may or may not be available at any given time. My problem: when the remote db is unavailable, any time my code tries to query the remote database it hangs for a few minutes until it times-out. I would very much like to change the timeout value to something
2006 Jun 26
1
Separate Read and Write Database
Hello, I need to access an mirrored database with one read and one write cluster. Is there a way to tell a model to use two connections? So that all updates etc go to the write database and all read from the read one? This is a fixed set up I can not use MySQL 5.x stuff and additionally i get a token on write, which can be checked on read (and wait for replication) if new data is needed. I
2006 Jan 11
0
Connection problem with a generic-runtime-built ActiveRecord::Base
Hi, I''m trying to create a "runtime-generic" ActiveRecord class, It means I don''t need to know the table or database, before I create my program ruby-rails. So I don''t need to predefine my database in environment.yml file and pre-build classes inherited from ActiveRecord::Base. I write some code, it seems to work. However, I can''t disconnect my