Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: Applying transaction boundaries

  1. #21
    Join Date
    Jan 2012
    Posts
    9

    Default

    JIRA issue created: https://jira.springsource.org/browse/DATAGRAPH-188

    Regards,
    Daniel
    Last edited by danielgig; Feb 3rd, 2012 at 08:48 AM. Reason: wrong link

  2. #22
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default

    Not adding much to this thread. But Daniel, I highly recommend overriding equals and hashCode in domain objects. Because the default implementation is via ==, which is memory address. So theoretically you could have two domain objects that data wise are the same domain objects, but are two different objects in the heap, and therefore equals will return false.

    While this isn't JPA or Hibernate here, it was required to override equals and hashCode because the apis underneath the querying would use it to make sure it never created two different instances with the same data from the db.

    Especially since these methods are used extensively in Collections, which with data models like we have will have plenty Collections to work with.

    Hope that helps

    Mark

  3. #23
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Mark, Daniel,

    if you want to add anything to the docs, please just fork the project edit the xml in the src/docbk directory and issue a pull request. Thanks a lot.

    Michael

  4. #24
    Join Date
    Jun 2012
    Posts
    18

    Default

    Unfortunatly, I'm having this issue. I have these seperations made (of the MVC controllers), I have the correct entry for <tx:annotation-driven mode="proxy" />, and have tried the others in this thread. But in my service, I get this exception. No issues with my tests, just actual code. It's just not getting wrapped in a transaction.
    Last edited by treaves; Nov 30th, 2012 at 10:30 AM.

  5. #25
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    But your service is injected into your controllers?

  6. #26
    Join Date
    Jun 2012
    Posts
    18

    Default

    Yes, they are.

  7. #27
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

    Any chance to share the project / a sample project to look at?

    If you get your service injected elsewhere or pull it directly from the context (e.g. in a single Main class), does the transaction work then?

  8. #28
    Join Date
    Jun 2012
    Posts
    18

    Default

    The transactions only work if they are in the classes the services call, which is how I've been working around this. So both the service injection & transaction injection work, just not in the same classes.

    I'll see about creating a sample project to show this; I have one I've used to demonstrate several other defects in the NEO4j code, so maybe it can be easily modified.

Posting Permissions

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