Displaying 13 results from an estimated 13 matches for "active_connections".
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 undertands is if the class varaible
@@act...
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 Jul 24
7
[PATCH] Support for DB Clusters/Replication in ActiveRecord (RFC)
...;database configuration specifies nonexistent #{config[:adapter]} adapter" end
+ end
@config, @adapter_method = config, adapter_method
end
end
@@ -20,6 +31,16 @@
# The class -> thread id -> adapter cache. (class -> adapter if not allow_concurrency)
@@active_connections = {}
+ # Define a connection pool for doing database reads.
+ @@read_connection_pool = {}
+
+ # Define a connection pool for doing database reads.
+ @@write_connection_pool = {}
+
+ # Used in looping the connection pools.
+ @@last_read_connection = {}
+ @@last_write_conn...
2006 Jan 18
1
Helps!!!!! Rails database connection guru needed!!!!!!!
...exactly the disconnection is done while we connect
ourself to another database???? As we can see in the
source code "remove_connection"
connectionspecification
def self.remove_connection(klass=self)
conn = @@defined_connections[klass]
@@defined_connections.delete(klass)
active_connections[klass] = nil
conn.config if conn
end
bascially, it removes the "table-linked-class" from
the class variable @@defined_connection and
@@active_connections. Actually it does not do anything
to disconnect the actually connection, So we wonder
will it lead to a memory leak of the ruby-...
2005 Dec 30
0
Changing the current connection for Active Record
...have to grant unneeded privileges for my application user
just so the unit tests will run. Does anyone understand the connection
handling and how it changed enough to help?
Thanks,
Matt
<snippet>
def self.with
old_connection = ActiveRecord::Base.connection
ActiveRecord::Base.active_connections[ActiveRecord::Base] =
connection
yield
ensure
ActiveRecord::Base.active_connections[ActiveRecord::Base] =
old_connection if old_connection
end
</snippet>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gma...
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 =>
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
2005 Sep 29
2
[BUG] Quick Fix for SCGI leaked DB connections
...d::Base.configurations =
File.open("#{RAILS_ROOT}/config/database.yml") { |f| YAML::load(f) }
ActiveRecord::Base.establish_connection
...
This solves the problem by telling AR to store it''s DB connections in a
different place. Normally it stores them in
Thread.current[''active_connections''] which means that, in single threaded
operation you don''t really get threaded_connections, and in multi-threaded
operation you get a heinous number of connections.
=== Implications ===
Since scgi_rails runs Rails inside a Synchronize block, you are *sort of*
getting sequential o...
2006 Jul 12
10
Rails: Good for everything?
My department is in a battle right now. We have some very por PHP
people and very pro Rails people. The php guys make a good argument
that Rails is good for new applications where we dictate the DB schema.
PHP shines where we go into an existing application, or a new one where
multiple databases or possibly legacy systems are involved. The PHP
guys basically say Rails is good for Web 2.0
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 Jan 26
0
If you want to disconnect a database properly, there is the code:)!!!
...@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_adapter
@connection = nil # remove the connection
cached in the Act...
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
2011 Dec 21
2
Panic or segfault in Samba 3.6.1 - Debian testing
Since upgrading to 3.6.1 in Debian testing, I receive a panic/segfault
message with each print job. Printing succeeds and continues to work,
but an email with the info below is sent each time.
The system is standalone. Kernel is 3.1.0-1-686-pae, and the system is
fully updated. testparm returns no errors.
Does this mean anything to anyone?
Dale
[Thread debugging using libthread_db