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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:06:07+00:00 2026-05-22T13:06:07+00:00

Currently when I try to insert new records I am getting an error: [ERROR]

  • 0

Currently when I try to insert new records I am getting an error:

[ERROR] 05/12/11_09:44:20.54 [org.hibernate.event.def.AbstractFlushingEventListener] – Could not synchronize database state with session

Db2 triggers to generate the ID need to remain in place to support legacy applications. How can I configure the hbm.xml to not generate the ID?

  • 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-22T13:06:08+00:00Added an answer on May 22, 2026 at 1:06 pm

    I’m not sure what version of Hibernate you are using, but Hibernate currently supports getting an ID that is generated from trigger via a special generator called select.

    In short, you can add this generator to your ID column, and then reference a natural key you can use to retrieve the trigger generated ID as follows:

    <id name="id" type="long" column="person_id">
      <generator class="select">
        <param name="key">socialSecurityNumber</param>
      </generator>
    </id>
    

    If your mapping already has a natural-key entry defined, then you shouldn’t even need to specify the key param to the generator.

    One problem with this particular generator is that you can only use one entity property as the selection key for it. If you need to select via a composite key, then you’ll have to create your own generator for this purpose.

    You could extend org.hibernate.id.SelectGenerator or one of it’s parents, and then implement the select via multiple columns that way. Then you simply replace the class attribute of the above generator entry with the fully qualified class name of your new generator.

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

Sidebar

Related Questions

I am currently looking at the unload event of a window to try to
Here is the code currently used. public String getStringFromDoc(org.w3c.dom.Document doc) { try { DOMSource
I'm currently working with PHPUnit to try and develop tests alongside what I'm writing,
I currently have issues in Webkit(Safari and Chrome) were I try to load dynamically
I'll try to make this as straight forward as possible. Currently our team has
I am attempting to insert a mass of records into SQL Server 2005 from
I'm tring to insert some records into my Sqlite database using the Entity Framework.
Hi currently have the problem, that I want to insert values in a postgres
when i try to insert each line into my oracle database i get an
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and

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.