CodeIgniter Forums

Full Version: session lock feedback
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi everyone
i want to give feedback when query takes long and user session locked, i mean like "you should wait until query ends"  i have tried but no results for me 
i have get_lock function in those pages
  • Session_database_driver.php 
  • Session_memcached_driver.php
  • session_redis_driver.php
  • Session_driver.php
i have tried which function works when session locks but i dont find.
i guess "SELECT GET_LOCK('".$arg."', 300) AS ci_session_lock")->row()->ci_session_lock" is locked my session but i did comment that line nothing is affected
thanks for suggestions
Hey,

I'am not shure I do understand your questen correct. But the documentation mention's that they use session for the following reason :

"non-blocking requests in the context of sessions also means unsafe, because modifications to session data (or session ID regeneration) in one request can interfere with the execution of a second, concurrent request. This detail was at the root of many issues and the main reason why CodeIgniter 3.0 has a completely re-written Session library."

Source : https://codeigniter.com/userguide3/libra...oncurrency
(03-19-2019, 03:33 AM)wjonker Wrote: [ -> ]Hey,

I'am not shure I do understand your questen correct. But the documentation mention's that they use session for the following reason :

"non-blocking requests in the context of sessions also means unsafe, because modifications to session data (or session ID regeneration) in one request can interfere with the execution of a second, concurrent request. This detail was at the root of many issues and the main reason why CodeIgniter 3.0 has a completely re-written Session library."

Source : https://codeigniter.com/userguide3/libra...oncurrency

thanks for reply but i read documents and i know why ci use get_lock, so it wont solve my problem
i just want to give feedback to users when session locks. for example query takes time about 5 minutes and user click another request, i want to give feedback like "the last request is running, you should wait for this"
@makif,

My question is more about the query. Why is it taking so long?
(03-20-2019, 06:57 AM)php_rocs Wrote: [ -> ]@makif,

My question is more about the query.  Why is it taking so long?
 user search about a year query and many conditions it takes a little bit long
and also i use exit in get_lock function on mysql database_driver page but not working, it turned query to me :/ how can i learn when session lockes
@makif,

Are you using AWS? What version of CI? Database?
(03-28-2019, 06:34 AM)php_rocs Wrote: [ -> ]@makif,

Are you using AWS? What version of CI? Database?

i am using nginx, also apache 2.4 at another place  for testing
CI version is 3.1.8
database mariadb 10.3.12