A Safe Multiple Transaction with Multiple Table

I have these 2 kinds of experience :

  1. I was employed by a hospitality-purpose software developer company, based on Pulau Pinang, Malaysia. But, I worked at their branch office in Medan, Indonesia. The case was, they had one feature, which was called Rate Code Program, that was used to manage hotel’s daily room rate. It was quite complex process, but the most problem that I faced was every time I tested the feature to save the rate codes and I found a problem, I needed to clear some data in database before I tested it again.
  2. Later than, I move to another company and I was assigned to develop a daily planning for fuel distribution system. Everything was going fine until the test phase came. It was not a really problem actually, but it was really annoying. Every time the system saved their daily plan, this mean that the system will send a lot of row of data, and the error occurred, I need to clean the database again before I tested it for next time.


From the experiences, we can conclude that I MADE A MISTAKE IN MY CRUD SYSTEM. Yes, I really admit it. And again it really annoyed me. Actually, the solution is really simple, considering we’re all now provided with advanced database management system. That means, at least, any major RDBMS like Oracle, SQL Server, MySQL, and PostgreSQL can implement this method.

Ok, straight to the point, the solution is you need to implement “Transaction Method” on this case of development.

This transaction method will allow you to manipulate your data manually. It’s depend on you whether you want to allow the changes happen or not. The implementation of this method is different on every RDBMS you use. For actual tutorial about this method, you could use their tutorial page for help.

Let’s talk about the effect. Some of you may already have a view about the effect of this method on your application. Well, I’ll make it even a crystal clear for you all. The effect is so simple, when the function that involve a lot of data row is started, then the transaction is started as well. As long as the application is running well and ended successfully, then you just make a function that could COMMIT your database transaction. If in the middle of process, you catch an error, just run a procedure that could ROLLBACK all the data that’s been queried earlier.

With your system implementing this method, you will never face problems that I have met before.

Hope that can help you all.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s