Package com.aashish.javaormashcode.jdbc
Class OrmSession
java.lang.Object
com.aashish.javaormashcode.jdbc.OrmSession
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionStarts a transaction by disabling auto-commit on the session connection.voidclose()Closes the session connection and rolls back any unfinished transaction.voidcommit()Commits the active transaction and restores auto-commit mode.Lazily opens and returns the JDBC connection used by this session.voidrollback()Rolls back the active transaction and restores auto-commit mode.
-
Constructor Details
-
OrmSession
-
-
Method Details
-
getConnection
Lazily opens and returns the JDBC connection used by this session. -
beginTransaction
Starts a transaction by disabling auto-commit on the session connection. -
commit
public void commit()Commits the active transaction and restores auto-commit mode. -
rollback
public void rollback()Rolls back the active transaction and restores auto-commit mode. -
close
public void close()Closes the session connection and rolls back any unfinished transaction.- Specified by:
closein interfaceAutoCloseable
-