jp.sf.amateras.mirage.session
Interface Session

All Known Implementing Classes:
DBCPSessionImpl, JDBCSessionImpl

public interface Session

The entry point of Mirage in stand-alone use.

You can control transaction and access SqlManager through this interface.

In addition, you can manage transaction automaticaly using this interface with OpenSessionInViewFilter. OpenSessionInViewFilter begin and commit transaction per request. It rollback transaction if it catches exception. So you can focus on operation of SqlManager.

Author:
Naoki Takezoe

Method Summary
 void begin()
          Begins the transaction.
 void commit()
          Commits the transaction.
 SqlManager getSqlManager()
          Returns the instance of SqlManager.
 boolean isRollbackOnly()
          Returns whether the current transaction has been marked as rollback-only or not marked.
 void release()
          Releases this session.
 void rollback()
          Roolbacks the transaction.
 void setRollbackOnly()
          Marks the current transation as rollback-only.
 

Method Detail

begin

void begin()
Begins the transaction.

Throws:
SessionException

commit

void commit()
Commits the transaction.

Throws:
SessionException

rollback

void rollback()
Roolbacks the transaction.

Throws:
SessionException

release

void release()
Releases this session.

Throws:
SessionException

setRollbackOnly

void setRollbackOnly()
Marks the current transation as rollback-only.


isRollbackOnly

boolean isRollbackOnly()
Returns whether the current transaction has been marked as rollback-only or not marked.

Returns:
If marked true; otherwise false

getSqlManager

SqlManager getSqlManager()
Returns the instance of SqlManager.

Returns:
Throws:
SessionException


Copyright © 2010-2012 Project Amateras. All Rights Reserved.