Hi Louis

My intention was to provide support in 3.3.0 only for the Tdbc connector class. I missed therefore the bug in dio_Sqlite.tcl

May I suggest to fix the problem in the traditional Tdbc connector by adding to dio_Sqlite.tcl these lines

public method create_field_formatter {} {
set special_fields_formatter [::DIO::formatters::Sqlite3 ::DIO::formatters::#auto]
    }

Otherwise it would break the Tdbc connector

Since it seems you're using Rivet in a Tcl9 environment it would be nice if you keep reporting more problems and observations

 -- Massimo


On 3/2/26 14:00, [email protected] wrote:
Hello Massimo,
the yyy is just obfuscated.

I enabled debugging and it fails with the message:
debug "session '$sessionCookie' alive, refreshing session update time"
Within the file rivet-master/rivet/packages/session/session-class.tcl line 288

Your suggested approach with Tdbc did work like a charm.

So currently no need for me to fix this, as I try to wrap my head arround it and try to fix it myselve.

I keep you updated.

In git-master (rivet-3.3.0) i had to change rivet-master/rivet/packages/ dio/formatters.tcl line 142 from Sqlite3 to Sqlite to get the traditional Sqlite connector working.

I compiled rivet-master with apache 2.4.65, tcl 9.0.3, tcllib 2.0

Quoting Massimo Manghi <[email protected]>:

Hi Louis

I guess the ip_address = 'yyy' is actually meant to conceal the actual address.

I recommend you adopt the Tdbc connector for Sqlite3 creating the handle with the modified DIO::handle form

::DIO::handle Tdbc Sqlite3 -db "/.../rivet-sqlite.db

after you have downloaded the latest version of dio_Tdbc.tcl from the repository. I spotted a bug in it that made the DIO result 'numrows' command fail

https://github.com/apache/tcl-rivet/blob/3.2/rivet/packages/dio/ dio_Tdbc.tcl

In case you want to stick to the traditional Sqlite connector please enable the debugging of the Session object instance and in case add more debug messages if it fails to show where it's failing to properly set the column updated values

 -- Massimo


On 3/2/26 11:31, [email protected] wrote:

Hello everyone,

i try to get sessions working with rivet 3.2.8, tcl 8.6.17, apache httpd 2.4.65, tcllib 2.0

This is my simple test page session-test.rvt
####################start
<?
package require sqlite3
package require Session
package require DIO
::DIO::handle Sqlite DIO -db "/.../rivet-sqlite.db"
Session SESSION -debugMode 0
SESSION activate

#set current_user [SESSION fetch global user_name]

#if {[::rivet::var exists username]} {
# set l_user [::rivet::var get username]
# SESSION store global user_name $l_user
#} else {
# set l_user ""
#}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto; }
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<div>User:<? #puts $current_user ?></div>
<p>Welcome to xyz the next thing <br/>Session id: <? puts [SESSION id] ?\
</p>
</body>
</html>
###################################end

The session works, until i let the session idle, if it tries to refresh the session i get this exception: Got 'near "WHERE": syntax error' executing 'UPDATE rivet_session SET WHERE 1 = 1 AND session_id = '4662D98DF8C0E99F79EF68C925F2Exxx' AND ip_address = 'yyy''
    while executing
"$this update $arrayName {*}$args"
    (object "::DIO" method "::DIO::Database::store" body line 21)
    invoked from within
"$dioObject store a -table $sessionTable -keyfield $kf"
    (object "::request::SESSION" method "::Session::id" body line 70)
    invoked from within
"id"
    (object "::request::SESSION" method "::Session::activate" body line 9)
    invoked from within
"SESSION activate"
    (in namespace eval "::request" script line 8)
    invoked from within
"namespace eval ::request $script"
    ("::try" body line 12)

Can someone help me to fix this?
Is this an error with my setup or with rivet itselve?

Unfortunally i am not able to file a bug report, as the bug software shows me "new bugs for rivet have been disabled".

Thank you!


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to