Database Connections & Global Variables

2003-07-25 Thread Levon Barker
Hello,

I have a question. 

If I have a $dbh global variable in a particular module that I 'use'. I know
that Apache::DBI will give a cached connection to the module to use.

But what if I do something like $dbh->commit();

Is it possible that I am committing data for another session by accident?

Any thoughts on this are appreciated. (Including RTFM (but tell me where in
the FMTR))

Cheers,
Levon Barker
<>

Win32, Libapreq, mod_perl-2 trouble

2002-07-18 Thread Levon Barker

Hello,

For mod_perl 1.x I used: 

ppm install http://theoryx5.uwinnipeg.ca/ppmpackages/libapreq.ppd

However, it doesn't seem to work for 2.0 as I get this error message in the
Apache error log:

[Thu Jul 18 14:54:07 2002] [error] 248: ModPerl::Registry: `Can't locate
object method "boot" via package "mod_perl::boot" at
C:/Perl/site/lib/Apache/Request.pm line 11.
Compilation failed in require at (eval 3) line 7.
BEGIN failed--compilation aborted at (eval 3) line 7.
'

Can someone point me in the right direction?

Levon Barker



RE: Understanding why this "fixes" my perlaccess script

2002-07-04 Thread Levon Barker

Not sure but I would try changing the query:

my $sth = $dbh->prepare("
SELECT id from session
WHERE field = ?
");
  $sth->bind_param( 1, $SessionID );
$sth->execute;

That might help.



-Original Message-
From: Jason Wilkes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 11:46 AM
To: [EMAIL PROTECTED]
Subject: Understanding why this "fixes" my perlaccess script


Hi folks,

I use the following modperl script to control page
access, based on a sessionid held in a cookie. A
database is queried to get the user id from the db
based on the cookie value. (No cookie, and your
bounced to the logon screen).

So far so good, and all works well. Except for one
user id (actually id=333), which causes an "internal
server error". If I put print debugging lines in -
everything works (even for user 333). If I take them
out again all other users work fine except 333.
Can anybody throw any light on this??

BTW: when the "internal server error" happens there is
no log of it in the error_log - although the HTTP
response code in access_log is 333 (which I don't
think is a valid response code).

Any thoughts would be much appreciated.

The code is: -

package My::Package;

use strict;
use Apache::Constants qw(:common);
use CGI::Cookie;
use DBI;

sub handler {

open (DBG, ">>/tmp/debug.txt"); # DEBUG LINE

my $r = shift;
my %cookies =
CGI::Cookie->parse($r->header_in('Cookie'));
return (FORBIDDEN) unless $cookies{'SessionID'};

my $SessionID = $cookies{'SessionID'}->value;

...
stuff to set up the DBI connection
...

my $sth = $dbh->prepare("
SELECT id from session
WHERE field = '$SessionID'
");
$sth->execute;
my $answer = $sth->fetchrow;

print DBG "The id is $answer\n"; # DEBUG LINE

$sth->finish;
$dbh->disconnect;

return (FORBIDDEN) unless $answer;

close (DBG);

}

1;
__END__







__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



RE: [JOB] Junior Mod_Perl Developer - New York City

2002-07-03 Thread Levon Barker

Did he say "out of the box" ?

-Original Message-
From: Brendan W. McAdams [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 03, 2002 1:50 PM
To: [EMAIL PROTECTED]
Subject: [JOB] Junior Mod_Perl Developer - New York City


(Note: Address to send resumes to is at bottom of this description; 
any resumes sent to my personal address will be ignored per company
policy)

TheMuniCenter is seeking an Apache/mod_perl developer to work on its
next generation bond trading system.  We are seeking an intelligent,
dynamic candidate capable of thinking outside of the box, working under
stress and meeting deadlines.  The ideal candidate should have
demonstrable project experience working with Apache/mod_perl. 
TheMuniCenter is NOT ANOTHER DOT COM!  We have an established, award
winning bond trading system backed by some of the biggest players in the
Financial Industry.  We are looking for another developer to help bring
us to the next level! We are seeking someone with all or most of the
following:
- In depth knowledge of Perl programming, with recent experience using
5.6 or higher in projects
- A reasonable understanding of regular expressions and their usage.
- Solid knowledge of Apache and its configuration and usage.
- Reasonable knowledge of mod_perl.  This includes the API, pitfalls and
benefits.
- Good programming skills.  These include logic, reasoning, problem
solving and proper application design.
- Web application development experience.  This includes a fair
knowledge of HTML (recent versions [4.x) and JavaScript, as well as good
UI design.
- Knowledge of SQL.
- Knowledge of Perl's DBI libraries for Database access.

In addition, we are always seeking candidates who also have the
following skills on top of those listed above:
- Java (Applets, servlets, JSP)
- J2EE (EJB)
- Weblogic 6
- Fixed Income Experience (Municipal & Corporate bonds, especially!)
- Database Experience - Sybase & Oracle.

Do you have what it takes to join one of the most dynamic development
teams on Wall Street?  Send resumes, with cover letter to
[EMAIL PROTECTED]  Serious applicants ONLY!



Re: Apache::Request - Win32

2002-06-24 Thread Levon Barker

That worked!!

I had installed the ActiveState libapreq.

Thanks for your help on this!



> On Sun, 23 Jun 2002, Levon Rubin Barker wrote:
> 
>> Hello.
>>
>> I'm sure this is a simple problem, but I'm a noob at mod_perl and
>> could use some help.
>>
>> I am running WinXP, Apache 1.3.26, Mod_perl 1.27_01-dev with libapreq
>> 0.31/
>>
>> The problem I am having is ...
>>
>> I get the following in the Apache Error log.
>>
>> [Sun Jun 23 08:44:06 2002] [error] Can't locate object method "new"
>> via package "Apache::Request" (perhaps you forgot to load
>> "Apache::Request"?) at (eval 12) line 9.
> 
> Did you get libapreq from ActiveState's repository? This one
> just has the .pm files - none of the C stuff - which might
> also explain this error. Try the libapreq available from
> 
> ppm install
>   http://theoryx5.uwinnipeg.ca/ppmpackages/libapreq.ppd
> 
> best regards,
> randy

_
Sign up for your Free RecHockey email at http://www.rechockey.net.