org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Country1

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Terracotta by girish_k, 1 year ago
object references an unsaved transient instance - save the transient instance before flushing: Country1
via Stack Overflow by Priyan RockZ
, 2 years ago
object references an unsaved transient instance - save the transient instance before flushing: com.priyan.patients.EPrescriber
via Stack Overflow by Nehu
, 2 years ago
object references an unsaved transient instance - save the transient instance before flushing: Parent
via Coderanch by Vijay Vishwanath, 1 year ago
object references an unsaved transient instance - save the transient instance before flushing: myapp.obj.AddressEntity
via Stack Overflow by aSsYin
, 2 years ago
object references an unsaved transient instance - save the transient instance before flushing: ma.project.sgcheque.model.Pays
via hivmr.com by Unknown author, 1 year ago
object references an unsaved transient instance - save the transient instance before flushing: com.bofa.news.entity.impl.account.ClientRoleImpl
org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: Country1
at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:219)
at org.hibernate.type.ManyToOneType.disassemble(ManyToOneType.java:163)
at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:80)
at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2194)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2138)
at org.hibernate.loader.Loader.list(Loader.java:2096)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at com.wakaleo.articles.caching.dao.CountryDAO.getCountries(CountryDAO.java:32)
at com.wakaleo.articles.caching.dao.CountryDAOTest.testGetCountries(CountryDAOTest.java:35)
at com.wakaleo.articles.caching.dao.CountryDAOTest.main(CountryDAOTest.java:91)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.