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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:22:39+00:00 2026-06-03T02:22:39+00:00

Hibernate has deprecated the connection() because they think the framework is so awesome that

  • 0

Hibernate has deprecated the connection() because they think the framework is so awesome that no-one will ever need the connection. And no, this is NOT the same thing as providing the connection, unless you are coming from Haskell. Anyways, I have a better idea to get rid of hibernate: a Connection wrapper arounds the hibernate session so I can pass the session around as a connection. I heard there is a way to get the connection with reflection. Does anyone know where I can get a wrapper like that?

public class SessionConnection implements Connection {

   private final Session session;
   private final Connection conn;

   public SessionConnection(Session session) {
       this.session = session;
       this.conn = getConnectionFromStupidHibernate(session);
   }

   // delegate methods go here
}
  • 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-06-03T02:22:40+00:00Added an answer on June 3, 2026 at 2:22 am

    If you’re using spring, just use the same DataSource you use for your SessionFactory – don’t design your app around hibernate, fit hibernate into your design

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

Sidebar

Related Questions

Hibernate has a handful of methods that, one way or another, takes your object
I have a Spring/Hibernate webapp that has some integration tests that run on an
I have an project using Hibernate. This has a class named Question . Each
I'm using Hibernate with Xml mappings. I have an entity that has two fields
I have a Java app that has an embedded Derby database (no hibernate though).
I have a hibernate pojo class and it has some field. Assume that there
Hibernate has the option to auto-detetect the hibernate.dialect . How can I retrieve that
I am using Hibernate as the ORM for a database that has a number
We have a Java web application that uses Spring and Hibernate and has a
my webapp has a hibernate config file that specifies db password as follows: <property

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.