Announcement Announcement Module
Collapse
No announcement yet.
Spring Framework Saving Data to Multiple Tables Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Framework Saving Data to Multiple Tables

    I'm working on a Spring MVC app and their JDBC api for data access. How would I go about saving data to multiple tables? The insertion needs to be such that if there's an error or something goes wrong, nothing gets inserted and rolled-back. Would this be Spring's transaction support? If so, the official documentation for transaction support is very confusing to me. Does anyone have a good source for learning how to do that?

    I'm using Spring 3.1, Oracle 11g, and Tomcat 6.0

  • #2
    Hello

    Wondered when you said that Spring Core documentation is not clear with Transactions.

    Try to research in google some examples, or buy some books.

    How would I go about saving data to multiple tables?
    You should have one business class that wraps other business class and these must have its data access object, then if somebody fails all must roll back I mean

    MasterBo
    • XBo ---> XDao ----> X Table in DB
    • YBo ---> YDao ----> Y Table in DB
    • ZBo ---> ZDao ----> Z Table in DB


    HTH

    Comment


    • #3
      Hi dr_pompeii,

      The problem I'm having is that I don't fully understand and I don't see good examples for using JDBCTemplate with transactions. Do you have any good blogs, articles, etc. with solid examples for using transaction managers? Please let me know.

      Thanks.

      Comment


      • #4
        Hello Robert

        The problem I'm having is that I don't fully understand and I don't see good examples for using JDBCTemplate with transactions.
        OK, I understand

        Do you have any good blogs, articles, etc. with solid examples for using transaction managers? Please let me know.
        An excellent book for JdbcTemplate + Transaction is Spring Recipes 2nd Edition

        HTH

        Comment

        Working...
        X