ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: SqlMapClient Transactions
Date Thu, 14 Apr 2005 14:29:21 GMT
You can expose the startTransaction etc... to your service layer
through your Dao interface. It will have the unfortunate side effect
of exposing specifics from your Dao to your service layer. This could
be defined as bad coupling. However, best practices would suggest you
should be managing your transactions on the service layer with
something like iBatis DAO or Spring.


On 4/14/05, sai nukala <techsnuke2003@yahoo.com> wrote:
> I have a basic need of applying transactions. 
> What are my options to implement Transactions under this scenario.. 
> My Objects (Just to give you my an understanding): 
> >>BaseDAO: Abstract IBatis DAO encapsulating Initialization of SqlMapClient
> and provides Insert/update/select methods... 
> >>TableDAOs: these DAOs are my DAOs which extend BaseDAO and provide methods
> to insert/update/select...by passing statement Id and parameterObject;
> Example EmployeeDAO deals with Employee tables in the database. 
> >>Service: these service objects abstract tableDAOs and create static
> TableDAO' for use in webapplication. 
> I am using these objects in struts/IBatis/Tomcat environment. 
> IBatis Transaction Manager Type is JDBC 
> Now I parse a huge file with 20 to 30 thousand records and perform inserts
> by calling service object which intern runs TableDAO. But every insert is
> either automatic transaction or start,commit and end have to be explicitly
> executed on the SQLMapClient.. 
> Can i create startTransaction, endTransaction and CommitTransaction in
> BaseDAO as i have reference to static SqlMapClient there? 
> How do i begin transaction outside of actual executeInsert statement...?
>  ________________________________
> Do you Yahoo!?
>  Yahoo! Small Business - Try our new resources site! 

View raw message