Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 239275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:34:21+00:00 2026-05-11T20:34:21+00:00

As my previous posts can attest, I’m retrofitting in-memory, network-cached performance to what was

  • 0

As my previous posts can attest, I’m retrofitting in-memory, network-cached performance to what was once an entirely hibernated scenario. In doing this, I’m hitting problems where I deal with proxied objects and need to reattach to sessions, but in doing this I also want to maintain transactability. What are the best practices from moving complex logic out of the hibernate layer? I’m just now “fully” coming into hibernate, so this is a rather hateful experience.

Can anyone who has worked with this kind of data movement elaborate on how you overcame the transaction problem, dealing with proxied objects, etc.? I’m just looking for general resources right now, as I’m struggling to swim.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:34:21+00:00Added an answer on May 11, 2026 at 8:34 pm

    You need to decide on 2 things:

    • Your session management strategy
    • Your associated fetching strategy

    There is good post by Gavin King that explains some of the options for handling sessions (the post is about performance, but is generally applicable too).

    As for fetching, one thing to consider is increasing the number of primitives made available by your Hibernate layer. E.g. imagine you have a entity Foo that has a 1-N relationship to Bar and some circumstances you need just the Foo objects, but in others you need both the Foos and the child Bar objects. You could those represented as separate calls to the Hibernate layer.

    class HibernateLayer {
        public List<Foo> findFoo(String someCriteria) {
            Query q = new Query("from Foo f where f.someCriteria = :1");
            //...
        }
    
        public List<Foo> findFooWithBars(String someCriteria) {
            Query q = new Query("from Foo f left join fetch Bar b where f.someCriteria = :1");
            //...
        }
    

    This has 2 benefits, 1 you won’t deal with lazy loaded proxy objects, you’ll have all the data that you need and it will perform better as the SQL generated will be more appropriate to the situation. However it will have the drawback that you will need to know before calling the Hibernate layer whether or not you will need the deeper level of data. To ensure that your data remains consistent (the main purpose of transactions) make sure you use optimistic locking at the very least.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 158k
  • Answers 158k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try changing: tbody tr:hover td.diff, tbody tr.diffcode:hover td pre {… May 12, 2026 at 11:12 am
  • Editorial Team
    Editorial Team added an answer I'd look into the the instrument package. Instrument the classes… May 12, 2026 at 11:12 am
  • Editorial Team
    Editorial Team added an answer AFAIK, the reflection-based "pseudo-events" in Global.asax are not accessible in… May 12, 2026 at 11:12 am

Related Questions

As my previous posts can attest, I'm retrofitting in-memory, network-cached performance to what was
I'm trying to build an InfoPath add-in to allow template editors (as opposed to
I'm migrating my WordPress blog and phpBB Forum into a new hosting server. I
I'm having problems with my application receiving low memory warnings while the user is
On my forum-based website, I have a link below every post for reporting spam

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.