spadefoot / kohana-orm-leap

An ORM module for the Kohana PHP framework that is designed to work with all major databases.
http://spadefoot.github.io/kohana-orm-leap/
100 stars 25 forks source link

Corrupt session #43

Closed bluesnowman closed 11 years ago

bluesnowman commented 12 years ago

Hello, am pretty interested by your module but i got stopped at the first trial.am using kohana 3.2 am quite new on kohana, but i've used zend and doctrine for php and hibernate/jpa for java. i'am having session corrupt exception.i've found that the session schema included in the leap is a little different

//default orm version
CREATE TABLE `sessions` (
  `session_id` VARCHAR(24) NOT NULL,
  `last_active` INT(10) UNSIGNED NOT NULL,
  `contents` TEXT NOT NULL,
  PRIMARY KEY (`session_id`),
  KEY `last_active` (`last_active`)
) ENGINE=MYISAM DEFAULT CHARSET=latin1

//leap version
CREATE TABLE `sessions` (
  `id` VARCHAR(24) NOT NULL,
  `last_active` INT(11) NOT NULL,
  `contents` LONGTEXT NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8

after i run the default orm version the error is gone. Please advise

blacksensei

bluesnowman commented 12 years ago

@CubedEye Got any ideas regarding this issue?

CubedEye commented 12 years ago

I'll have a look...

It looks like the DB ENGINE and CHARSET could be the issue. Also maybe the session_id/id field.

Is the issue happening when switching from the native ORM to LEAP? you may need to update the config to map the 'session_id' from 'id' to 'session_id' to match what the schema is expecting.