So let say if user is on 4th form now if he jumps to the 1st form we have to fetch it from the database that is also cost to performance.Which has its own cost, which is much higher, as your server stops working.
To save this cost we use to save the data into session.
As per your suggestion if we save data to DB with auto commit false then are we able to retrieve those data from DB?Of course, as long as it's inside the same transaction.
If i understand correctly then i have only 2 options either i save them to database or store them to session.You don't understand correctly. Nobody has said any such thing. I have suggested one alternative that will work. There may be others.
Depends on the size of data we should prefer the option like if its large number of data then database is preferred option and in reverse case session.That is mostly meaningless gibberish, but I reiterate what I said above. There is no point in comparing the performance of a solution that doesn't work with the performance of a solution that does work. You can get the wrong answer, or a down server, in zero time, if that's the objective. It isn't.