Massimo Manghi wrote:
Hi everybody

I'm sending on the list a file including patches for "dio" and "session"
and some new files that add support for Mysql and Oracle.

These patches are 99% work of Arnulf Wiedemann. I tested
the code on Mysql (Arnulf is intensively using the module for Oracle)
and made some minor changes.
Mysql doesn't remove the expired sessions rows from
rivet_session_cache: mysql accepts the syntax 'ON DELETE CASCADE'
for portability when creating the database, but it takes no action
upon deletion of an expired session from 'rivet_session'. Actual
support for this hasn't  been added as of version 5.0. In order
to suggest a workaround I added the file
'session-purge-mysql.sql' with a sql statement that
could be run from cron job.
Hello,

I had this problem with sqlite, which also does not (or did not) support ON DELETE CASCADE. I used a trigger in the file 'session-create.sql':

create table rivet_session(
  ip_address        inet,
  session_start_time    timestamp,
  session_update_time    timestamp,
  session_id        varchar,

  UNIQUE( session_id )
);

create table rivet_session_cache(
session_id varchar REFERENCES rivet_session(session_id) ON DELETE CASCADE,
  package        varchar,
  key                 varchar,
  data                varchar,

  UNIQUE( session_id, package, key )
);
create index rivet_session_cache_idx ON rivet_session_cache( session_id );

create trigger fkd_session_id
before DELETE ON rivet_session
for each row begin
  DELETE FROM rivet_session_cache WHERE session_id = OLD.session_id;
end;


Regards Oliver


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to