A transaction is defined as a logical unit of work (LUW) - one or more SQL statements that are treated as a single atomic operation. Either all statements in the transaction complete successfully, or none do (ACID properties). A transaction is not simply a logon/logoff sequence, nor is it limited to a single SQL statement, and while it relates to recovery, it's not defined solely by recovery units.