On 12/15/06, Marc Espie <[EMAIL PROTECTED]> wrote:
I'm trying to use DBIx::Class through dbi:proxy, the idea being that I want
to get to an access database from a unix machine, and that the win32 odbc
connector works just fine.

I've used this setup through DBI proper without any issue, so I know it
works. I've solved the first hurdle, namely I have to tell
SQL::Abstract::Limit about the type of database handle, since it can't
deduce it itself.

However, now DBIx insists on ping'ing the dbh to make sure it's alive...
and that doesn't work: dbi:proxy refuses to ping the dbh, saying I'm
not authorized (I suspect that DBI passes commands through verbatim,
and that the proxy server doesn't know how to do ping's simply, so it
doesn't bother).

I'm stumped. Any way to tell DBIx::Class to stop caring ?


->ping really needs to work, or you will always have problems with
DBIx::Class.  ->ping is how it is able to tell that your connection is
still alive and that it doesn'tneed to reconnect.  The development
branch doesn't ->ping on every statement like the current release, but
it still relies on ->ping's correct behavior in exception situations.

Rather than look for a way to make DBIx::Class stop caring, you should
look for the cause of the "not authorized" message, and get ping
working with your DBD's.  AFAICS, DBD::Proxy does support proxying
"ping", and DBD::ODBC does have a ping method.  You'll notice in the
DBD::ODBC source that the ping method looks a little fragile, likely
that's what's breaking on MSAccess.  There's also right below that an
"oldping" they saved for posterity.  Try hacking on that ping source
and come up with a valid ping method that reliably tells you the
database connection is still working.  "SELECT 42" and checking that
the DB successfully returned the value 42 is a good start for most SQL
databases.

-- Brandon

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to