0

I am designing a live demo version of a software I wrote. The database is modeled using MySQL, and comes with dummy data ready to use. What I would like to do is to have it generated the time a user signs in to try the demo, and have it be removed after he/she logs off or closes the system. What would be the best approach to solve such problem?

1 Answer 1

1

when a user login you can open a transaction in the database and never do the commit, then when he log out you just do a rollback or wait for database session expires.

This solution is easy to implement and the changes will be not visible for other users.

http://dev.mysql.com/doc/refman/5.6/en/commit.html

2
  • This is a very interesting idea, it had not occurred to me. Will give it a shot. Thanks a lot! Jul 21, 2015 at 16:29
  • I am working on the implementation of your solution, I start a transaction at the login routine, and rollback at the logout routine, but somewhere in the code a commit is being done, so I'm looking into it. Nevertheless, your solution seems to be the way to go, so thanks again for taking the time to answer! My best regards. Jul 27, 2015 at 20:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.