yii - PHP: Is there a relationship between PDO transactions and Sessions? -
i working on project uses yii , stumbled across made me scratch head. started db transaction using yii (which calls pdo::begintransaction) , did database stuff , @ end, store flash message user , redirect. forgot though commit transaction nothing got stored in database, caught attention flash message did not appear. doing commit or rollback makes flash message appear fine.
basically, noticed not store session related data , have stick after redirect if started transaction , didn't commit/rollback. don't leave transactions hanging never noticed behavior before.
so there relationship between 2 prevent sessions working properly?
session written database @ end of request. if make explicit rollback, still gets written db outside of transaction. if don't, rollback happens implicitly after session saving queries run.
Comments
Post a Comment