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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:37:32+00:00 2026-05-20T05:37:32+00:00

Please go through the simple scenario below, I couldn’t find a better way to

  • 0

Please go through the simple scenario below, I couldn’t find a better way to ask the question in textual form:

Two domain objects and a transactional service:

A {
 int id
 String prop1
 B b
 static constraints = {b nullable:true}
}

B {
 int id
 String prop1
 // not worring about belongsTo here
}



SomeService {

 def transactional = true
 def sessionFactory

 def aTransactionalMethod() {
  Sql sql = new Sql(sessionFactory.currentSession.connection())

  sql# create A some how with sql query leaving property b as null.

 A a = A.findById(...)
 //a.b must be null here, never mind

 sql# create B object somehow with sql query.

 // should a.b be available now? I'm getting null here.. session.currentSession.refresh(a) resolves the issue but why is that?
 }
}
  • 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-20T05:37:32+00:00Added an answer on May 20, 2026 at 5:37 am

    Hibernate can’t parse SQL, so it doesn’t “know” what you write to database. Hibernate will not reload all session objects – that would definitely be huge overhead.

    Maybe if you rewrite your query to HQL the objects will become available to session in immediately.

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

Sidebar

Related Questions

possibly a simple question, but I couldn't find definitive answer (see below for excerpt
A simple question about accessing array information through pointers that I can't seem to
I am new starter android. I have simple question. When I choose date through
I have a python question that I'm sure is pretty simple - please feel
I have created a simple email form on a website - Processing it through
Can someone please identify how this site has the effect of sliding through pages?
Please i need help, this code below works fine on my localhost, php5.3+ but
Please help me with this code - I am basically going through a book
OK, knowledgeable programmer-types, please be gentle... I'm having trouble getting a very simple, one-view
Being fairly new to iPhone / Objective-C development, I wanted to ask this question

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.