Displaying 8 results from an estimated 8 matches for "defined_connection".
Did you mean:
defined_connections
2006 Jan 18
1
Helps!!!!! Rails database connection guru needed!!!!!!!
...can see in the source code :
Call stack for postgresql
1- any controller
2- connectionspecification.establish_connection
3- ActiveRecord::base.postgresql_connection(config)
4- ConnectionAdapters::PostgreSQLAdapter.new(
PGconn.connect(), logger )
5- connection_specification.establish_connection
@@defined_connections[self] = spec
The connection is made while Rails calls
PGconn.connect(), then the connectionstored in
@connection of the adapter class. while a request is
send to the adapter,the adapter will sends the request
to the database via its variable @connection.But where
exactly the disconnection is done...
2006 Aug 13
1
establish_connection method
....establish_connection(spec = nil)
case spec
when nil
raise AdapterNotSpecified unless defined? RAILS_ENV
establish_connection(RAILS_ENV)
when ConnectionSpecification
clear_active_connection_name
@active_connection_name = name
@@defined_connections[name] = spec
when Symbol, String
if configuration = configurations[spec.to_s]
establish_connection(configuration)
else
raise AdapterNotSpecified, "#{spec} database is not
configured"
end
else
spec = spec.sym...
2006 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
...eturn if @@allow_concurrency == threaded
clear_all_cached_connections!
@@ -52,8 +89,9 @@
end
def active_connection_name #:nodoc:
+ # This must use name, not active_connection_name
@active_connection_name ||=
- if active_connections[name] || @@defined_connections[name]
+ if write_connection_pool[name] || read_connection_pool[name]
name
elsif self == ActiveRecord::Base
nil
@@ -70,13 +108,24 @@
# Returns the connection currently associated with the class. This can
# also be used to "borrow&...
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 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
2006 Jan 26
0
If you want to disconnect a database properly, there is the code:)!!!
...d by the postgres.so for
disconnect the database
@connection.close
@connection = nil # clear the connection
end
end
In connection_specification.rb, add the following code
at the end (in the "ActiveRecord::Base" class section)
def self.clear_connection(klass=self)
@@defined_connections.delete(klass) # remove
the connection
ac = active_connections # get the active
connection
ac.delete(klass) if ac.kind_of?(Hash) #
remove the connection
self.connection.disconnect # disconnect the
link with database, it call the newly added methode in
postgresql_adapt...
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