Results 1 to 2 of 2

Thread: Hibernate + Spring -> NonUniqueObjectException

  1. #1
    Join Date
    Sep 2004
    Location
    Argentina
    Posts
    23

    Default Hibernate + Spring -> NonUniqueObjectException

    Hi,
    i have a testing application with a Struts Action that uses a proxied bean with transaction demarcation and works fine. The Action object simply creates some persistent objects.

    The problem arrises when that Action is invoked by two (or more) simultaneous clients. In this case i get a NonUniqueObjectException. I think it's probably because the proxy i get from the factory is a singleton associated to the same Session for both requests, but i can't set de singleton property to false in TransactionProxyFactoryBean.

    Can someone help me with this issue?

    Thanks in advance
    - N!K -

  2. #2
    Join Date
    Sep 2004
    Location
    Argentina
    Posts
    23

    Default

    Hi again, i think i have the problem fixed.
    The action object was using a SequenceDao to generate de IDs for the new rows in the DB from the values in a Sequence table (with sequenceName=value pairs where sequenceName is TABLE_NAME.ID_FIELD_NAME).
    The problem was that the DAO was not flushing the Session before the other Thread entered the mutex block and made a SELECT to get the next sequence value.

    I hope this helps other people with the same 'programming' problem i had. If not... this message is nothing but useless.
    - N!K -

Similar Threads

  1. Replies: 5
    Last Post: Feb 3rd, 2009, 05:19 AM
  2. Replies: 3
    Last Post: Aug 16th, 2007, 12:10 PM
  3. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 7
    Last Post: Aug 21st, 2004, 03:42 AM

Posting Permissions

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