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 36261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:21:55+00:00 2026-05-10T14:21:55+00:00

It seems to me that introducing an ORM tool is supposed to make your

  • 0

It seems to me that introducing an ORM tool is supposed to make your architecture cleaner, but for efficiency I’ve found myself bypassing it and iterating over a JDBC Result Set on occasion. This leads to an uncoordinated tangle of artifacts instead of a cleaner architecture.

Is this because I’m applying the tool in an invalid Context, or is it deeper than that?

When can/should you go whole hog with the ORM approach?

Any insight would be greatly appreciated.


A little of background:

In my environment I have about 50 client computers and 1 reasonably powerful SQL Server.

I have a desktop application in which all 50 clients are accessing the data at all times.

The project’s Data Model has gone through a number of reorganizations for various reasons including clarity, efficiency, etc.

My Data Model’s history

  1. JDBC calls directly
  2. DAO + POJO without relations between Pojos (basically wrapping the JDBC).
  3. Added Relations between POJOs implementing Lazy Loading, but just hiding the inter-DAO calls
  4. Jumped onto the Hibernate bandwagon after seeing how ‘simple’ it made data access (it made inter POJO relations trivial) and because it could decrease the number of round trips to the database when working with many related entities.
  5. Since it was a desktop application keeping Sessions open long term was a nightmare so it ended up causing a whole lot of issues
  6. Stepped back to a partial DAO/Hibernate approach that allows me to make direct JDBC calls behind the DAO curtain while at the same time using Hibernate.
  • 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. 2026-05-10T14:21:56+00:00Added an answer on May 10, 2026 at 2:21 pm

    Hibernate makes more sense when your application works on object graphs, which are persisted in the RDBMS. Instead, if your application logic works on a 2-D matrix of data, fetching those via direct JDBC works better. Although Hibernate is written on top of JDBC, it has capabilities which might be non-trivial to implement in JDBC. For eg:

    1. Say, the user views a row in the UI and changes some of the values and you want to fire an update query for only those columns that did indeed change.
    2. To avoid getting into deadlocks you need to maintain a global order for SQLs in a transaction. Getting this right JDBC might not be easy
    3. Easily setting up optimistic locking. When you use JDBC, you need to remember to have this in every update query.
    4. Batch updates, lazy materialization of collections etc might also be non-trivial to implement in JDBC.

    (I say ‘might be non-trivial’, because it of course can be done – and you might be a super hacker:)

    Hibernate lets you fire your own SQL queries also, in case you need to.

    Hope this helps you to decide.

    PS: Keeping the Session open on a remote desktop client and running into trouble is really not Hibernate’s problem – you would run into the same issue if you keep the Connection to the DB open for long.

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

Sidebar

Ask A Question

Stats

  • Questions 71k
  • Answers 71k
  • 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
  • added an answer in sqlserver 2005 reference or example: SELECT * FROM (… May 11, 2026 at 1:22 pm
  • added an answer Use QStackedWidget. You insert several widgets which correspond to the… May 11, 2026 at 1:22 pm
  • added an answer I'm assuming that you are using .NET here. That being… May 11, 2026 at 1:22 pm

Related Questions

No related questions found

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.