A database transaction comprises of the operations performed against the data in one or more databases. It is an atomic unit that contains one or more SQL statements which are executed as a whole for retrieving or updating data in the database. It may contain the operations such as SELECT, INSERT, UPDATE or DELETE singly or as a whole, or it may be an operation which alters the physical structure of the database. The outcome of the statements in the transaction may be any of the following
1. all committed – all saved permanently in database
2. all rolled back
2. all rolled back
The JNLP protocol defines different parameters for a Java application, like the location of the jars, resources etc. JNLP can be considered as an alternative to an applet based application, as it offers some of the same functionality,launching an application from a URL, caching parameters etc.
This feature gives application the ability of deploying automatically just by referring where you can find the files(resources) on the Web.
If the transaction is completed successfully, it ends with COMMIT and the results will be permanently recorded in the database. Otherwise if it is a failed and terminated transaction, it ends with ROLLBACK to revert the transaction effects on the database.
State of the data before COMMIT or ROLLBACK
Commit Transactions
This includes making the modifications which are executed by the statements in the transaction permanent.
COMMIT ;
COMMIT ;
State of the data after COMMIT
Rollback of Transactions
Savepoints in Transactions
These are intermediate markers in the transaction which divide the entire transaction into smaller units. Its application is in long transaction where we can mark the work at any intermediate point. So if we make an error in the midst of a complex transaction, we can rollback the operations performed after this declared savepoint and before the current point in the transaction.
The savepoints can be declared using the statement
SAVEPOINT name;
The savepoints can be declared using the statement
SAVEPOINT name;
Also the names of the savepoints within a single transaction must be distinct. Thus if a second savepoint with the same name as the earlier is created, the first savepoint will be erased. We can rollback to the savepoint by using the statement :
ROLLBACK TO SAVEPOINT name;
State of the data after ROLLBACK TO SAVEPOINT