Announcement Announcement Module
No announcement yet.
Ibatis : having session to span multiple dao calls Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ibatis : having session to span multiple dao calls


    I'm currently evaluating IBatis, and struggling to see if it is possible to achieve prepared statements reuse between daos (subclasses of org.springframework.orm.ibatis.SqlMapClientTemplat e) calls.

    It seems you need to have the same ibatis session to achieve that.
    From what I can see, the only creation of session is in org.springframework.orm.ibatis.SqlMapClientTemplat e#execute.

    What I was expecting (or hoping for) is the ability to declaratively describe in my spring application context, the extent for an IBatis session (as we can do for a transaction).
    Is there any known way to achieve that ?

  • #2
    Not that I have much knowledge or experience with iBatis, what is it you are trying to do and why? Surely the only thing you need to span Daos is the transaction?
    Last edited by karldmoore; Feb 19th, 2007, 01:49 PM.


    • #3
      I'm trying to make IBatis reuse prepared statements if the same DAO is called multiple times in a given transaction.

      But considering how IBatis / Spring interact and how IBatis implements the PreparedStatement cache, it seems it is needed to have the IBatis session be shared across the calls to the DAOs.