View RSS Feed

Recent Blogs Posts

  1. Batch Updates and Transactions

    by , 04-27-2012 at 07:18 PM
    It is important to keep in mind, that each update added to a Statement or PreparedStatement is executed separately by the database. That means, that some of them may succeed before one of them fails. All the statements that have succeeded are now applied to the database, but the rest of the updates may not be. This can result in an inconsistent data in the database.

    To avoid this, you can execute the batch update inside a transaction. When executed inside a transaction you can make ...
  2. Using Annotations for Transactions in Spring

    by , 11-27-2011 at 10:38 PM
    In the previous tip, I showed you how you could use XML to define a transaction. In this tip we will look at doing the same using annotations. It is blindly simple to use annotations for transactions. The tx namespace provides the <tx:annotation-driven> element. It appears like this :

    Java Code:
    <tx:annotation-driven transaction-manager="txManager" />
    With this you can now define transaction rules very easily. This tag tells Spring to examine all beans in ...
  3. Configuring Transactions in XML with Spring

    by , 11-27-2011 at 10:33 PM
    Continuing from my previous post, I will demonstrate how you can declare transactions in XML using Spring. Continuing from the previous tips on transaction attributes, letís dive straight in. Spring has a tx configuration namespace to simply declaring transactions in Spring. It is recommended that you include the aop namespace as well since some of the declarative transaction configuration elements use AOP configuration elements. The following shows how <tx:advice> is used for the Car service. ...

    Updated 11-27-2011 at 10:36 PM by Spring Framework

    Categories
    XML , Spring 3 , Configuration , Transaction
    Attached Thumbnails Attached Images  
  4. Key Attributes of Spring Transactions

    by , 11-27-2011 at 10:25 PM
    Transactions are defined as doing a business unit of work. It is a key functionality that enable you to control concurrent access of data by multiple business operations. This is done in order to safeguard integrity and ensure that data remains in a consistent state. If for any reason the unit of work could not be completed as an indivisible unit of work, all the changes are unwound and the system is returned to its previous state. The key properties for the design of any application is to ensure ...

    Updated 11-30-2011 at 01:06 PM by Spring Framework

    Categories
    Transaction