Actually I wouldn't sugest splitting your database.

As for having the latest version, yes, the ppm from the AS Rep uses
SQLite3.x and thus is the relatively latest version. Simply DON'T share
that particular handle. Open a second one in the second thread and
SQLite3 will handle it just fine (there were some problems with 2 and
threads from any language).

Opening and closing multiple times is certainly *not* required at all.
My program has a thread that keeps it open all of the time because it is
*constantly* accessing the DB with tracking information, and another
thread that opens a handle every 5 minutes for a >1 second operation. In
*that* case its appropriate for memory usage etc.

I also do suggest using Jez's suggestion of a separate thread to do all
the handling of the DB for you. I can't turn around and do that in my
existing program even if I wanted to (6500+ lines in the main script
alone excluding the ~1500 in modules). I am however rewritign the entire
program with updated DFDs and logic, so I'll get to it in the end.

As with all things perl, TIMTOW. Work with a couple of ideas and find
which is best for you.

Jason P.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Roger Mayfield
Sent: Friday, April 07, 2006 5:14 AM
Cc: perl-win32-gui-users@lists.sourceforge.net
Subject: Re: [perl-win32-gui-users] Using Threads with Win::32 and
Net::IRC

Jeremy White wrote:

>
>> Since both threads will be accessing the same database, would I need 
>> to connect and then close the database handle every time I query it 
>> or can the handle be left open? add as far as accessing the database,

>> I
>
>
> Most databases can handle concurrent connections, so you should be 
> able to leave each handle open.
>
> An alternative design methodology - is to use a single thread handling

> database access, with the Net::IRC thread and the GUI sending 
> "requests" to the database thread (via thread queues). This approach 
> has several advantages (such as responsiveness as your Net::IRC and 
> GUI thread don't block on database access) but the downside is the 
> extra work involved
>
> Cheers,
>
> jez.
>
well, considering I need to access some information before I ever start
the thread, I'll just go ahead and split my database.

Roger Mayfield



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting
language that extends applications into web and mobile media. Attend the
live webcast and join the prime developer group breaking into this new
coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/

Reply via email to