Inactive Timeout Warning for E-Commerce Websites


PHP OBSERVER

We have seen in almost all websites that after certain time user automatically gets signed out. I had received a requirement where after 10 minutes of inactivity our site will show a warning that “You are about to sign out” and within 1 minute of this warning if user don’t respond the site will sign the user out.

How to proceed:
First prototype: So we decided first JavaScript will check for idle time and show warning, and after 1 more minute, do an Ajax call to sign user out. Implemented it.

Problem:
We all know advance users will open the site across tabs. Now suppose user kept Tab-1 inactive and working on Tab-2. So according to our first prototype Tab-1 will sign him out after total 11 minutes of inactivity although he is working on Tab-2. Need to think of a solution.

View original post 292 more words

Advertisements

Cross Database Transaction in MYSQL


PHP OBSERVER

As database developer almost all of us use “Transaction” in more or less every projects. But have we ever done transaction which involve multiple databases. Or do we know how to handle this.

If you think in MYSQL it is same as normal transaction, you are wrong. Transaction doesn’t support operation across databases.

XA Transaction

“XA transaction” is the way how we can implement transaction which involve multiple databases.
Below are the following commands which are available for xa-tansaction.

XA START xid;
XA END xid;
XA PREPARE xid;
XA COMMIT xid;
XA ROLLBACK xid
XA RECOVER

View original post 453 more words

Are You MySQL a Developer? Look into MariaDB


PHP OBSERVER

MariaDB??? What is it???

Yes it is the correct time to know about it. MariaDB is coming as a replacement of MYSQL (World’s most used open source database). Oracle is bringing mariaDB as a replacement of MySQL (which is also owned by oracle). The goal for MariaDB is to be a drop-in replacement for MySQL – with more features and better performance.

What do we mean by drop-in replacement?

  • Data and table definition files (.frm) files are binary compatible.
  • All client APIs, protocols and structs are identical.
  • All filenames, binaries, paths, ports, sockets, and etc… should be the same.
  • All MySQL connectors (PHP, Perl, Python, Java, .NET, MyODBC, Ruby, MySQL C connector etc.) work unchanged with MariaDB.

There are some installation issues with PHP5 that you should be aware of (a bug in how the old PHP5 client checks library compatibility).

View original post 384 more words