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

  • SEARCH
  • Home
  • 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 6592565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:34:16+00:00 2026-05-25T17:34:16+00:00

There are technically two questions here, but are tightly coupled :) I’m using Hibernate

  • 0

There are technically two questions here, but are tightly coupled 🙂

I’m using Hibernate in a new project. It’s a POS project.
It uses Oracle database.

We have decided to use Hibernate because the project is large, and because it provides (the most popular) ORM capabilities.

Spring is, for now, out of the question – the reason being: the project is a Swing client-server application, and it adds needless complexity. And, also, Spring is supposed to be very hungry on the hardware resources.

There is a possibility to throw away Hibernate, and to use JDBC. Why? The project requirement is precise database interaction. Meaning, we should have complete control over the connections, sessions and transactions(and, yes, going as low as unoptimized queries).

The first question is – what are your opinions on using the mentioned requrement?

The second question revolves around Hibernate.

We developed a simple Hibernate pilot project.
Another project requirement is – one database user / one connection per user / one session per user / transactions are flexibile(we can end them when we want, as sessions).
Multiple user can log in the application at the same time.

We achived something like that. To be precise, we achived the full described functionality without the multiple users requirement.

Now, looking at the available resources, I came to a conclusion that if we are to have multiple users on the database(on the same schema), we will end up using multiple SessionFactory, implementing a dynamic ConnectionProvider for new user connections. Why?

The users hashed passwords are in the database, so we need to dynamically add a user to the list of current users.

The second question is – can this be done a little easier, it seems weird that Hibernate doesn’t support such configurations.

Thank you.

  • 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-25T17:34:17+00:00Added an answer on May 25, 2026 at 5:34 pm

    If you’re pondering about weather to use Hibernate or JDBC, honestlly go for JDBC. If your domain model is not too complex, you don’t really get a lot of advantages from using hibernate. On the other hand using JDBC will greatly improve performance, as you have better control on your queries, and you get A LOT less memory usage from not habing all the Hibernate overhead. Balance this my making an as detailed as possible first scetch of your model. If you’re able to schetch it all from the start (no parts that are possible to change wildly in throughout the project), and if said model doesn’t look to involved, JDBC will be your friend.

    About your users and sessions there, I think you might be mistaking (tho it could just be me), but I don’t think you need multiple SessionFactories to have multiple sessions. SessionFactory is a heavy object to initialize, but once you have one you can get multiple hibernate session objects from it which are lightweight.

    As a final remark, if you truly stick with an ORM solution (for whatever reason), if possible chose EclipseLink JPA2 implementation. JPA2 has more features over hibernate and the Eclipselink implementation is less buggy then hibernate.

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

Sidebar

Related Questions

Technically two questions - but they are so heavily related I didn't want to
I know that technically all three ways below are valid, but is there any
There have been a few questions like this around the place but none have
I know it is customary, but why? Are there real technical reasons why any
This is not a technical question, but given that there are a few iPhone
There are two weird operators in C#: the true operator the false operator If
While the languages F# and IronPython are technically dissimilar, there is large overlap between
OK, this is rather broad question but ... Is there a chart that says
This is actually two questions in one: First, when you write your XAML and
I have a question, the answer isn't really hard technically, but I am more

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.