Page 4 of 4 FirstFirst ... 234
Results 31 to 33 of 33

Thread: Need advice on exception handling approach

  1. #31
    Join Date
    Aug 2006
    Posts
    12

    Default

    I am also facing the same problem. Not able to catch those exceptions in Service layer without issuing explicit flush.

    From the above posting, I am not able to find out any concrete solution for this problem.

    So, How to solve this issue ?

  2. #32
    Join Date
    Aug 2006
    Posts
    12

    Default

    Also if this problem can be solved using flush, then how can we rollback the transaction?

    If we use flush, Will TransactionManager can rollback this transaction if there is any issue ??

  3. #33
    Join Date
    Jul 2006
    Location
    Philadelphia, PA, USA
    Posts
    341

    Default

    Hi haishan,

    Quote Originally Posted by haishan View Post
    Also if this problem can be solved using flush, then how can we rollback the transaction?

    If we use flush, Will TransactionManager can rollback this transaction if there is any issue ??
    You can flush (synchronize the state with the database) and later rollback the transaction. This is the equivalent of using straight JDBC and writing to the database with a connection whose autoCommit mode is set to false, and then later rolling back the transaction.

    Hibernate itself (by default) performs a flush prior to a query if there are changes held in memory that would affect the results of a query. This default behavior would not work if you could not later rollback the transaction.

    -Arthur Loder

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •