From a non expert:
Configuration: represent the mappings and other configuration in files (xml or properties), is the in-memory version of that files
SessionFactory: Once a configuration is loaded a SessionFactory may be created. SessionFactories lets create Sessions.
Session: A session is a connection to the data base, in orden to do queries you must first connect to the DB, that is done by obteaining a Session from the SessionFactory, (Remember to close the session or it will keep open and you may run out of connections)
Transaction: The same as in normal SQL, all the statements included in a tranasction are nor reflected until a transaction.comit() is done, and all statements must execute correctly, if one of them fails a exception is thrown, by catching the exception you can do a rollback wich basically mens to undo the previously changes made in the transaction. To resume, or all statements in a transaction are correctly executed or none of them.
|