iBATIS 2.0 Released


News: iBATIS 2.0 Released

  1. iBATIS 2.0 Released (29 messages)

    On behalf of the iBATIS team, I'd like to announce the release of iBATIS version 2.0. The iBATIS SQL Mapping framework is known as a simple and practical solution for dealing with large, complex or even bad enterprise databases that don't map well to a single object model. However, it's also an excellent alternative to plain old JDBC for any application.

    iBATIS is open source software and is freely available under an ASF-like license.

    You can download the software, documentation and examples from http://www.ibatis.com

    The iBATIS SQL Mapping framework is designed for the real world, where there are no perfect database designs and no perfect object models. On many projects the database is beyond our control and we cannot change it. With iBATIS you won't have to. iBATIS is NOT an Object Relational Mapper and is therefore not limited to table-class relationships.

    SQL Maps put the full power of real SQL at your fingertips. There are no complex O/R mappings or query languages to learn. You already know SQL and XML, and that's all you need. There are no classes to extend, nor code to generate. Here is one example of a simple SLQ Map:

    <select id="getAddress"
          ADR_ID as id,
          ADR_DESCRIPTION as description,
          ADR_STREET as street,
          ADR_CITY as city,
          ADR_PROVINCE as province,
          ADR_POSTAL_CODE as postalCode
        from ADDRESS
        where ADR_ID = #id#

    The statement above can be executed like this:

    Integer pk = new Integer(5);
    Address address = (Address) sqlMap.queryForObject("getAddress", pk);

    Features include:

      * iBATIS SQL Mapping Framework
          - Full power of real SQL
          - Works with complex, enterprise, ERP or even poorly designed databases
          - Fully supports composite keys and complex relationships
          - Complete stored procedure support
          - JavaBeans support
          - Primitive wrappers (Integer, String, Date etc.)
          - HashMap, List, Collection, and array[]
          - XML text and DOM Support
          - Null value translation
          - Auto-mapping bean properties to columns
          - Dynamic SQL using conditional XML tags
          - Caching and dependency management
          - Centralized data source configuration
          - Local and global (JTA) transaction support
          - Small footprint 300k (minimum)
          - Minimal dependencies (only commons-logging required)
          - Spring DAO Templates available (popular alternative to iBATIS DAO)
      * Optional Data Access Objects Framework
          - Simple DAO framework
          - Centralized data source configuration
          - Templates for SQL Maps, Hibernate and JDBC
          - Local and global (JTA) transaction support
    JPetStore is the official example application for iBATIS and is also available from the website.

    Visit http://www.ibatis.com for more information.

    Kind regards,

    Clinton Begin

    Threaded Messages (29)

  2. Thanks, Clinton![ Go to top ]

    I used the previous version in a medical document delivery App. and was pleased with my choice. However, the App. itself was pretty straightforward and the domain model was simple. Your mileage may vary.

    1. Work directly with SQL, so you can use UNION, outer joins, and vendor-specific features (gasp!). This helps a lot with complicated query functionality.
    2. Easy to get up-and-running.
    3. Lazy loading support
    4. Caching support (but I didn't try it)

    1. I had trouble writing CLOBs and BLOBs to the DB, but that was somewhat of an Oracle problem, too. I seem to remember being able to read them fine, though.
    2. Writing the piddly SQL (standard CRUD for javabeans) is tedious.

    -Matt Ring
  3. Good work![ Go to top ]

    We've been using RCs and we were waiting unpatiently for final release! ;)

      We have recently made a comparison of iBatis DBL and typical O/R tools, and we have finally concluded that iBatis is what we really need.

      It has some features we needed (SQL based, externalization of statements, declarative caching, bean mapping, tolerant to bad DB designs, paginated lists...). But the feature I like more is its simplicity, it requires low technical skills and that reduces technical risks.

      You know, keeping it simple is sometimes the key to success! :)

      My congratulations to iBatis team. Keep it on.
  4. Maps can get messy[ Go to top ]

    I tried iBatis, and was pleased with it overall, but found I made a mess of the maps pretty quickly, trying to re-use resultMaps for getting top level objects as well as children of other objects. I found the ids I chose started to collide.

    This isn't something that is iBatis' fault, but I think some best practices for map organization and naming need to be put into place if not enforced by the framework. It seems that maybe adding some sort of namespace handling in the naming of ids might be helpful as well.
  5. Maps can get messy[ Go to top ]

    I think this is a great suggestion and is already on the to-do list. I'd like to see a Patterns and Best Practices section of the documentation.

    Perhaps we'll put out a request for pattern submissions from the community as well (a forum maybe?).

  6. Maps can get messy[ Go to top ]

    There is a configuration setting 'useStatementNamespaces' which will
    allow you to refer to mapped statements using their fully qualified name.
    This allows you to have the same statement name in different sqlmaps.

    Example from iBATIS doc:
  7. Maps can get messy[ Go to top ]

    I see examples use iBATIS API, is it some tool to generate DAO from XML files ?
    It must be trivial to generate DAO implementation at runtime too (dynamic proxy). I use this way and it works without problems for me.
  8. www.ogamo.com is using iBatis v2 (and Struts, Resin, Eclipse and some rich UI) and it is in beta. (Tiles are dynamic, configure w/: http://www.basicportal.com/bp/download/cms.PNG) It will go live soon.

    One nice feature, if you join the beta site, is that you can have your home page "username".domain.com. (So if you join as user "vic", you can go to http://vic.ogamo.com and see a FoaF like friends, etc. )
    The site replaced an ASP Vinyette gameing CMS portal with for 5 magazines for Ziff Davis and 10MM members. When it goes live, it will be called www.1up.com.

    (Game sofware is bigger than Movies.)

  9. ... more[ Go to top ]

    Matt, one can extend Struts/iBatis making CRUD easy, and no need to map beans then in version 2 of iBatis, it's optional. (I sometimes use collections only, so it's loosley coupled and works nice with Rich UI. So I can just add a field in UI or DB layer, the midle part is just a collection so no change in Java.) Go KISS!

    More on the Struts CMS extensions:

  10. CRUD[ Go to top ]

    Matt, one can extend Struts/iBatis making CRUD easy...
    I would say iBatis CRUD is not that easy as Hibernate one, especially when an object has few collections of dependent objects/links.
    I would say that Hibernate ORM is more convenient if you have developed DB schema simultaneously with application, but iBatis works definitely better if a project needs to deal with a bad (not necessary legacy ) DB schema.
  11. CRUD[ Go to top ]

    I see this as a tooling problem. If you have a tool that can generate the mapping for the basic CRUD, it would be as easy as Hibernate. And its actually not that big of a deal to quick hack something together for this purpose which is what I did for my project.

    I understand that the team is now working on a similar tool; http://genx.sf.net.
  12. CRUD[ Go to top ]

    Agree, for CRUD, tools can't be beat. I personally prefer the doclet approach for crud type stuff (like Hibernate's XDoclet tags). Others are developing tools based on DDL, DBMD, JavaBeans etc.

    There are a lot of possibilities.

  13. ORM vs Relational[ Go to top ]



    I also agree with above; I found ORM (Hibernate, JDO, EJB) loses transparency and is limitting when you have performance needs or more complex apps, so iBatis like (SQL and relational ) DAO works better.

  14. ORM vs Relational[ Go to top ]

    Konstatin,http://sourceforge.net/forum/forum.php?thread_id=1093167&forum_id=206693I also agree with above; I found ORM (Hibernate, JDO, EJB) loses transparency and is limitting when you have performance needs or more complex apps, so iBatis like (SQL and relational ) DAO works better..V
    I do not know how to mesure project size, but it must be true for "large" database , "many" transactions and long life cycle (performance tuning after DB grows).
  15. ORM vs Relational[ Go to top ]

    I found ORM (Hibernate, JDO, EJB) loses transparency and is limitting when you have performance needs or more complex apps, so iBatis like (SQL and relational ) DAO works better..V
    From my experience Hibernate performs poorly when somebody tries to use it to fetch list of complex objects just to display a few fields from main object. Yeah, it surely creates huge overhead in numbers of queries and amount of fetched data.
    Well, it is usual trade: convenience vs. speed. As it was mentioned many times, it is necessary to understand what a FW is doing and when.
    Specifying exact fields we need in HQL (hibernate query language) instead of blindly returning object itself easily gives 400% performance boost.

    As usual people find it easier to do nearly everything themselves than try to understand why a product or technology does things in a certain way only to discover later ( how Gavin King said: 50000 lines of code later) that they do basically the same thing but rather poorly (track evolution of XML-RPC/SOAP).

    Now, iBatis really has advantages in a certain circumstances, when fine-tuning is necessary and a developer wants to use full power of underlying RDBMS, also it is more efficient for really complex joins.
    I am considering iBatis to be a complementary to an ORM for doing list queries for displaying purposes and doing CRUDs in ORM (Hibernate).

    (I wish iBatis fix that bug with CustomConnection, it does not seem to work now ).
  16. ORM vs Relational[ Go to top ]

    (I wish iBatis fix that bug with CustomConnection, it does not seem to work now ).
    Hi Konstantin,

    I'm not sure what CustomConnection is...that's not a class in iBATIS. Could you post a message on the support forum (or a link if you already have)?


  17. CustomConnection is...[ Go to top ]

    (I wish iBatis fix that bug with CustomConnection, it does not seem to work now ).
    Hi Konstantin,I'm not sure what CustomConnection is...that's not a class in iBATIS.oops.. I meant to say SqlMapSession#setUserConnection( Connection )
  18. iBATIS 2.0 Released[ Go to top ]

    Congratulations on the release! I saw Clinton's demo in New York this April during Vic's seminar - it was very impressive.

    A comment on raw SQL and ORM. Traditionally there has been a big gap indeed (if you use ORM object queries, you can't do raw SQL). Well, not anymore. Cayenne SQLTemplate query provides iBatis-like functionality integrated with the rest of ORM:


    Instead of XML it uses Velocity for highly dynamic parameterized SQL creation (I thought this will produce more readable and easily scriptable templates). Also you can create and manage the templates using CayenneModeler GUI.

    If you don't care about an ORM at all, iBatis is an excellent solution.

  19. iBATIS 2.0 Released[ Go to top ]

    This looks like a nice product.. I've been bouncing through some of the example code and information. One question.. how does this handle the caching and lazy-loading? I know with Hibernate that can really bite people when they toss objects up to their view for presenting. I work around that with filters to open/close sessions, but its somewhat awkward. How is it handled here?

    Also, is this lazy-loading for local objects only? What if I was exposing objects via RMI? Do I have a way to force an object/collection to fully load itself in the event I want to remote it?

  20. iBATIS 2.0 Released[ Go to top ]

    iBATIS lazy loading does not rely on an open session or an open connection. It will use the current connection if it is there, but it will also fetch a new connection if it needs to.

    As for RMI and/or clustering: classes containing lazy loaded properties are not serializable. So the answer is "yes", you would need to fully load an object to remote it or serialize it in any way.

  21. Whit is lazy loading?[ Go to top ]

    You nentioned "lazy loading"?
    Actually, I don't know what you mean!!
    I can guess what "lazy loading" is.
    Can you explan about that more?
    Thanks advanced!!!
  22. What is lazy loading?[ Go to top ]

    You nentioned "lazy loading"?Actually, I don't know what you mean!!I can guess what "lazy loading" is.Can you explan about that more?Thanks advanced!!!
    Lazy loading is deferring the loading of data until requested. For example, if you have an order with al list of line items, you can load the order, and transparently defer the loading of the list of line items until you request that list. This keeps the initial database interaction to a minimum, and can potentially eliminate many of your database hits.
  23. iBATIS 2.0 Released[ Go to top ]

    I have used this in some toy projects and I liked it a lot since it is so simple.

    However it's release candidate versions had some huge bugs that should have been caught. eg lazy loading was totally broken in rc3, and they even changed the api somewhat at rc5 I think

    This does make me kind of nervous
  24. iBATIS 2.0 Released[ Go to top ]

    Yes, there were some changes late in the RC stages that caused some fluctuations. However, it's better to get these done and over with before final release. Ideally it's best to get it out before beta, but things don't always line up the way we like. Especially not with software. ;-)

    The changes were worth it.

  25. iBATIS 2.0 Released[ Go to top ]

    Sure but release candidate is kind of a misnomer then

    When something hit's rc status I expect very few bugs, and an api that doesn't change anymore till the final release
  26. iBATIS 2.0 Released[ Go to top ]

    I agree. That's what I expected too. Unfortunately what I expect does not always matter.
  27. Congratulations[ Go to top ]

    Congratulations Clinton and team!

    I am a happy user of iBATIS now. I went from JDBC to JDO to Hibernate to iBATIS and really think iBATIS is the simplest and most effective solution. It certainly lives upto its promise. I really don't see the reason for all the hoopla around ORMs. The only thing I would wish for now is a mapping UI for iBATIS.
  28. We LOVE iBatis in Europe[ Go to top ]

    We use iBatis for all our Web projects. We love it!

    Full steam development power without unnecessary complexity. We have had to work with OR mapping frameworks in the past and we think iBatis ER is so much better.

    Sample projects:

    http://www.wrgfm.com (Radio station with > 6000 interactive user community)

    http://who.arvkit.net/en/index.jsp (World Health Organization; the app is also distributed as searchable CD-ROM around the world in 4000 copies).

    Great job, Clinton.
  29. Hi,

       I am asking this bcoz I afraid that if the web application get bigger and more and more user using your website, then we need load balancing and also clustering environment.
       Beside, is there any tutorial on using IBatis with Spring together? Thanks !

  30. Ibatis is a great framework and relatively very easy to use.

    resultset="xml" is great but needs improvements like supporting 1:n related sql data
    example pseudo sql: select <employee, roles> from emp,roles where <join condition>
    Lets say above returns multiple roles for a user
    we need the result as

    Unfortunately, i could not use xml with composite sql statements in Ibatis SQL Mapping as it doesnot associate 1:N relations as expected. (correct me if it exists)

    Are there any plans to support this?