Re: [AOLSERVER] Scoping in AOLserver TCL
Rob Mayoff wrote: +-- On Sep 5, Mike Hoegeman said: you can clean up things when a connection ends using the ns_atclose command. e.g. In this case, it's a lot safer for Brian to use namespace delete ::whatever at the top of the procedure that sets the namespace variables. That way he guarantees that there will be no extraneous variables. oh.. did not realize that the whole namespace could be nuked.. ok.. -mike
Re: [AOLSERVER] Scoping in AOLserver TCL
That's what I am doing! I have to say though that my code's readability has deteriorated somewhat. It was bad enough having things like: eval set SumX $$SumName when I wanted SumX to be either Sum1 or Sum2 etc.. now I've replaced it with: eval set SumX \$::ba_ns::$SumName Yack! Cheers, Brian -Original Message- From: Rob Mayoff [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, September 05, 2001 4:38 PM To: [EMAIL PROTECTED] Subject: Re: [AOLSERVER] Scoping in AOLserver TCL +-- On Sep 5, Mike Hoegeman said: you can clean up things when a connection ends using the ns_atclose command. e.g. In this case, it's a lot safer for Brian to use namespace delete ::whatever at the top of the procedure that sets the namespace variables. That way he guarantees that there will be no extraneous variables.
Re: [AOLSERVER] AOLserver Chat recommen
Of course, an IRC server is simple enough to set up on any machine -- I can gladly host it on my box. It's not like IRC is a high-bandwidth service... My two bits. Michael Kriston Rehberg wrote: Unfortunately, most of these IRC servers immediately reject people coming in from .aol.com domains. The openprojects.net server seems to do this as well. I guess IRC is not an option, then, since many of our developers are in .aol.com. Kris -- Kriston Rehberg mailto:[EMAIL PROTECTED] AOL Technology Development
Re: [AOLSERVER] connsperthread
I have a form that is generated from a query result set, and in each record, there is a select widget which is, in turn, generated from a query result set. I can't run the inner query until the outer query is exhausted, so I need 2 handles, I think! Personally, I think I would run the first query until it's through, saving the data in whatever format you want, a list or an array, and then go through and do the second set of queries. But that's just me. Another poster mentioned that you can get multiple handles from one call of ns_db gethandle. Rusty -- Rusty Brooks : http://www.rustybrooks.org/ Spewing wisdom from every orifice --
Re: [AOLSERVER] connsperthread
Ian Harding wrote: [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: dbinit: db handle limit exceeded: thread already owns 1 handle from pool 'pgpool' [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: could not allocate 1 handle from pool pgpool I believe you probably did something like this: set db [ns_db gethandle pgpool] (any code except ns_db releasehandle $db) set db2 [ns_db gethandle pgpool] The second call results in an error. If you need two handles, set db_list [ns_db gethandle pgpool 2] set db [lindex $db_list 0] set db2 [lindex $db_list 1] If a filter which runs before your script is also using a handle, it might not be returning the handle to the pool, resulting in the same error. connsperthread has nothing to do with this error. --Tom Jackson
Re: [AOLSERVER] connsperthread
At 03:06 PM 9/5/01, you wrote: I thought about that, but other than style, is there any advantage to one technique over the other? Database connections aren't free, but neither are lists and arrays... I believe that's your measure of memory and cpu and slashdots. You probably have a lot more available memory and cpu power than database connections. If so, than storing the data and not nesting the loops, will not use too many resources and will not take too long, and it will keep your database connections available to more people when you get slashdotted. It may be a bit harder to develop your logic. If you never need to worry about slashdotting, or database connections are truly inexpensive and you have tons of them, then use all the database connections you want, and your individual pages might be a bit easier to develop and execute. Jerry Jerry Asher [EMAIL PROTECTED] 1678 Shattuck Avenue Suite 161 Tel: (510) 549-2980 Berkeley, CA 94709 Fax: (877) 311-8688
[AOLSERVER] [ aolserver-Bugs-458929 ] Ns_Set implementation and null bytes
Bugs item #458929, was opened at 2001-09-05 15:21 You can respond by visiting: http://sourceforge.net/tracker/?func=detailatid=103152aid=458929group_id=3152 Category: Architecture: Server (nsd) Group: aolserver3_4 Status: Open Resolution: None Priority: 5 Submitted By: Adam Zell (zellster) Assigned to: Nobody/Anonymous (nobody) Summary: Ns_Set implementation and null bytes Initial Comment: Given the following URL: http://foo.com/index.htm?a=1%002 There isn't a convenient way to grab the full value of 'a' through Ns_QueryToSet(), since it relies on the Ns_Set implementation, which itself relies on C strings. The user will see only '1'. If Ns_Set was changed to use Ns_DString's internally, the user would be able to access '1\02' (or any non- ASCII data) correctly. -- You can respond by visiting: http://sourceforge.net/tracker/?func=detailatid=103152aid=458929group_id=3152
Re: [AOLSERVER] connsperthread
Err. Methinks you are right. I have a form that is generated from a query result set, and in each record, there is a select widget which is, in turn, generated from a query result set. I can't run the inner query until the outer query is exhausted, so I need 2 handles, I think! Ian A. Harding Programmer/Analyst II Tacoma-Pierce County Health Department (253) 798-3549 mailto: [EMAIL PROTECTED] [EMAIL PROTECTED] 09/05/01 02:17PM From http://aolserver.com/docs/admin/con-ch3.htm#156726 : ConnsPerThread Default: 100 After the specified number of connections, a connection thread will exit. This parameter is useful for working around memory leaks in Tcl code. Which indicates that ConnsPerThread has nothing to do with DB stuff. Is there a particular reason you need two db connections open at the same time (to the same pool)? Rusty On Wed, 5 Sep 2001, Ian Harding wrote: Well, I tried uncommenting the connsperthread and setting it to 2 so I can have 2 connections to the database within a thread. However, it does not seem to work. It looks like this... ns_param connsperthread 5 ;# Normally there's one conn per thread But I get this... [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: dbinit: db handle limit exceeded: thread already owns 1 handle from pool 'pgpool' [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: could not allocate 1 handle from pool pgpool I looked at the docs and could not find any leads. Any ideas? Ian A. Harding Programmer/Analyst II Tacoma-Pierce County Health Department (253) 798-3549 mailto: [EMAIL PROTECTED] -- Rusty Brooks : http://www.rustybrooks.org/ Spewing wisdom from every orifice --
Re: [AOLSERVER] connsperthread
That makes sense. Sorry for the noise... Ian A. Harding Programmer/Analyst II Tacoma-Pierce County Health Department (253) 798-3549 mailto: [EMAIL PROTECTED] [EMAIL PROTECTED] 09/05/01 02:37PM You are seeing this error because you have to allocate both DB handles in 1 ns_Db call. This is to avoid deadlocks when handles get low. Jim From http://aolserver.com/docs/admin/con-ch3.htm#156726 : ConnsPerThread Default: 100 After the specified number of connections, a connection thread will exit. This parameter is useful for working around memory leaks in Tcl code. Which indicates that ConnsPerThread has nothing to do with DB stuff. Is there a particular reason you need two db connections open at the same time (to the same pool)? Rusty On Wed, 5 Sep 2001, Ian Harding wrote: Well, I tried uncommenting the connsperthread and setting it to 2 so I can have 2 connections to the database within a thread. However, it does not seem to work. It looks like this... ns_param connsperthread 5 ;# Normally there's one conn per thread But I get this... [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: dbinit: db handle limit exceeded: thread already owns 1 handle from pool 'pgpool' [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: could not allocate 1 handle from pool pgpool I looked at the docs and could not find any leads. Any ideas? Ian A. Harding Programmer/Analyst II Tacoma-Pierce County Health Department (253) 798-3549 mailto: [EMAIL PROTECTED] -- Rusty Brooks : http://www.rustybrooks.org/ Spewing wisdom from every orifice --
Re: [AOLSERVER] connsperthread
I thought about that, but other than style, is there any advantage to one technique over the other? Database connections aren't free, but neither are lists and arrays... Thanks for all the responses! Ian Ian A. Harding Programmer/Analyst II Tacoma-Pierce County Health Department (253) 798-3549 mailto: [EMAIL PROTECTED] [EMAIL PROTECTED] 09/05/01 02:38PM I have a form that is generated from a query result set, and in each record, there is a select widget which is, in turn, generated from a query result set. I can't run the inner query until the outer query is exhausted, so I need 2 handles, I think! Personally, I think I would run the first query until it's through, saving the data in whatever format you want, a list or an array, and then go through and do the second set of queries. But that's just me. Another poster mentioned that you can get multiple handles from one call of ns_db gethandle. Rusty -- Rusty Brooks : http://www.rustybrooks.org/ Spewing wisdom from every orifice --
[AOLSERVER] connsperthread
Well, I tried uncommenting the connsperthread and setting it to 2 so I can have 2 connections to the database within a thread. However, it does not seem to work. It looks like this... ns_param connsperthread 5 ;# Normally there's one conn per thread But I get this... [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: dbinit: db handle limit exceeded: thread already owns 1 handle from pool 'pgpool' [05/Sep/2001:14:08:54][19325.21][-conn2-] Error: could not allocate 1 handle from pool pgpool I looked at the docs and could not find any leads. Any ideas? Ian A. Harding Programmer/Analyst II Tacoma-Pierce County Health Department (253) 798-3549 mailto: [EMAIL PROTECTED]