You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Tom Lloyd <th...@yahoo.com> on 2010/03/11 16:25:51 UTC

Problems

I have identified that the problems start with apache when i have added this to my httpd.conf

RivetServerConf ChildInitScript "package require Session; Session SESSION \
  -cookieLifetime 120 -debugMode 1"

When apache tries to spawn new processes they do not work anymore. 

Thanks 

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Session Database

Posted by Massimo Manghi <ma...@unipr.it>.
Hi Tom

Thomas Lloyd wrote:
> Hi Massimo,
>
> Again your right about mysqltcl. I am working on two systems one at work
> and one at home testing my set-up in both locations. I thought I had
> installed mysqltcl at both locations. I had not at home where I was
> getting this error message. Not knowing how DIO works also threw me. So
> I now have Rivet, DIO, Session and mysqltcl all working together. 
>
> My next question  comes about the database that DIO/Sessions uses.
>
> Do I have to create a database in mysql to hold the session data?
>
>   

yes, the Session package won't create the database structure, but if you 
look at

trunk/rivet/packages/session/

you'll find sql scripts for each backend supported by DIO. If you have 
mysql I recommend you have mysql-server 5.1 installed.
> Do I have to define the structure of the tables and database?
>
>   
You certainly have to create a database with authorization privileges 
that grant to your scripts adequate rights for the session tables (at 
least privilege to insert, delete and update rows)

> If I have to define the structure then is there a template or a minimum
> structure to work from? 
>
>   
I think this question basically got answered already. 'Session' has 
already methods for storing your application data represented as 
strings. Needless to say the whole point about sessions is that you want 
a method for associating client and application state. The session class 
instance has the methods for doing it, understanding what data and in 
which form is up to your design.

> Or does Session create the data fields as required in the named database
> on the fly?
>
>   
again I think I answered

> Does session clean up the old data from the database? 
>
>   
yes, every page of your application should call the method 'activate' in 
order to refresh the session status. Within this method a clean up of 
expired sessions data is carried out randomly.

> Thanks again,
>
> Tom  
>   

hope I understood your problems.

 -- Massimo

---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Session Database

Posted by Thomas Lloyd <th...@yahoo.com>.
Hi Massimo,

Again your right about mysqltcl. I am working on two systems one at work
and one at home testing my set-up in both locations. I thought I had
installed mysqltcl at both locations. I had not at home where I was
getting this error message. Not knowing how DIO works also threw me. So
I now have Rivet, DIO, Session and mysqltcl all working together. 

My next question  comes about the database that DIO/Sessions uses.

Do I have to create a database in mysql to hold the session data?

Do I have to define the structure of the tables and database?

If I have to define the structure then is there a template or a minimum
structure to work from? 

Or does Session create the data fields as required in the named database
on the fly?

Does session clean up the old data from the database? 

Thanks again,

Tom  








---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Problems

Posted by Damon Courtney <da...@tclhome.com>.
Massimo is right.  You need to download and install the mysqltcl package in order to use DIO with MySQL.  DIO supports several databases, but each one requires the specific extension for that database.  If you google for mysqltcl, you should find it pretty easily.

Damon


On Mar 12, 2010, at 9:22 AM, Massimo Manghi wrote:

> Well, it looks like you dont' have the mysqltcl package installed. Rivet (with its session package) and Mysql work well together. I've been using them for 4 years now and I remember fixing the mysql support for the session package was my very first small contribution to Rivet.
> 
> -- Massimo
> 
> Thomas Lloyd wrote:
>> You got it on the nose. I had compile rivet using tcl8.5 but the Itcl
>> package I was using from Ubuntu was compiled against 8.4. So i
>> recompiled rivet against 8.4 and now at least it does not seg fault when
>> I start apache. 
>> The next issue, as per the instructions on the rivet website I am trying
>> to call the DIO object to connect to a database before calling session. 
>> I am getting this error message from this code:
>> 
>> 
>> puts "DIO - [package require DIO]"
>> set dbhandle [::DIO::handle Mysql -host host -port port -user user -pass
>> pass -db db]
>> 
>> --------------------------------------------------------------------------
>> No MySQL Tcl package available
>>   while executing
>> "::DIO::Mysql #auto -host host -port port -user user -pass pass -db db"
>>   ("uplevel" body line 1)
>>   invoked from within
>> "uplevel \#0 ::DIO::$interface $obj $args"
>>   (procedure "::DIO::handle" line 9)
>>   invoked from within
>> "::DIO::handle Mysql -host host -port port -user user -pass pass -db db"
>>   (in namespace eval "::request" script line 9)
>>   invoked from within
>> "namespace eval request {
>> puts -nonewline "
>> 
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
> For additional commands, e-mail: rivet-dev-help@tcl.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Problems

Posted by Massimo Manghi <ma...@unipr.it>.
Well, it looks like you dont' have the mysqltcl package installed. Rivet 
(with its session package) and Mysql work well together. I've been using 
them for 4 years now and I remember fixing the mysql support for the 
session package was my very first small contribution to Rivet.

  -- Massimo

Thomas Lloyd wrote:
> You got it on the nose. I had compile rivet using tcl8.5 but the Itcl
> package I was using from Ubuntu was compiled against 8.4. So i
> recompiled rivet against 8.4 and now at least it does not seg fault when
> I start apache. 
>
> The next issue, as per the instructions on the rivet website I am trying
> to call the DIO object to connect to a database before calling session. 
>
> I am getting this error message from this code:
>
>
> puts "DIO - [package require DIO]"
> set dbhandle [::DIO::handle Mysql -host host -port port -user user -pass
> pass -db db]
>
> --------------------------------------------------------------------------
> No MySQL Tcl package available
>     while executing
> "::DIO::Mysql #auto -host host -port port -user user -pass pass -db db"
>     ("uplevel" body line 1)
>     invoked from within
> "uplevel \#0 ::DIO::$interface $obj $args"
>     (procedure "::DIO::handle" line 9)
>     invoked from within
> "::DIO::handle Mysql -host host -port port -user user -pass pass -db db"
>     (in namespace eval "::request" script line 9)
>     invoked from within
> "namespace eval request {
> puts -nonewline "
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Problems

Posted by Thomas Lloyd <th...@yahoo.com>.
You got it on the nose. I had compile rivet using tcl8.5 but the Itcl
package I was using from Ubuntu was compiled against 8.4. So i
recompiled rivet against 8.4 and now at least it does not seg fault when
I start apache. 

The next issue, as per the instructions on the rivet website I am trying
to call the DIO object to connect to a database before calling session. 

I am getting this error message from this code:


puts "DIO - [package require DIO]"
set dbhandle [::DIO::handle Mysql -host host -port port -user user -pass
pass -db db]

--------------------------------------------------------------------------
No MySQL Tcl package available
    while executing
"::DIO::Mysql #auto -host host -port port -user user -pass pass -db db"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 ::DIO::$interface $obj $args"
    (procedure "::DIO::handle" line 9)
    invoked from within
"::DIO::handle Mysql -host host -port port -user user -pass pass -db db"
    (in namespace eval "::request" script line 9)
    invoked from within
"namespace eval request {
puts -nonewline "


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org


Re: Problems

Posted by Massimo Manghi <ma...@unipr.it>.
'Session' is a pure IncrTcl package. It might be worth checking whether 
you're loading an Itcl package that goes along with the Tcl library 
against which you have compiled Rivet. I had problems with this issue 
and could not move my applications to Tcl8.5 until Debian started to 
ship Itcl packages build for that version.

 -- Massimo

Tom Lloyd wrote:
> I have identified that the problems start with apache when i have added this to my httpd.conf
>
> RivetServerConf ChildInitScript "package require Session; Session SESSION \
>   -cookieLifetime 120 -debugMode 1"
>
> When apache tries to spawn new processes they do not work anymore. 
>
> Thanks 
>
> Tom
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org