this is an issue when using a remote checkout gateway. A remote checkout gateway is one where you are directed to the gateways site to perform the transaction instead of entering credit card info directly on your own site.
the limitation to a remote checkout gateway, is that they do not perform the transaction with the merchant bank in real time.
in other words, the customer goes to the gateway site, enters the payment info, confirms the payment and is then redirected to your site. At this point the transaction itself is placed into a queue to be processed with the bank on a first come first served basis.
I have no idea how CCAVENUE works, it's not a gateway i have ever worked with before, but with paypal standard, they have a system called IPN (Instant Payment Notification) this is used to post the results of the transaction when it is processed to page on your site that has been configured to accept this post.
With Paypla standard, you would configure the IPN p[age to store the order information in the database for the order when the IPN post comes back to the site. CCAVENUE is not a supported gateway, so i cant really tell you how to configure it, but they should have something similar to the IPN system that paypal uses.