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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:17:24+00:00 2026-05-26T07:17:24+00:00

I’ve run into an interesting play on the infamous inserting null fields from the

  • 0

I’ve run into an interesting play on the infamous inserting null fields from the Entity into a database.

Say I have the following table

ID | Number(10) | Not Null

Some_Number | Number(25) | Nullable

Some_Date | DATE Default(sysDate) | Nullable

I have the following Entity

@Entity
@Table(name="SOME_TABLE")
public class MockEntity implements Serializable{

private static final long serialVersionUID = 1L;
@Id
@Column(name="ID", nullable=false)
private Long myId;
@Column(name="SOME_NUMBER")
private Long someNumber;
@Column(name="SOME_DATE")
private Date someDate;


//Basic getters and setters here    

}

The Perssitence Uint in my persistence.xml is as follows

 <persistence-unit name="someSortOfPU" transaction-type="RESOURCE_LOCAL">
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
         <property name="show_sql" value="true"/>
         <property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
        <property name="javax.persistence.jdbc.url" value="someUrl"/>
         <property name="javax.persistence.jdbc.user" value="someUser"/>
        <property name="javax.persistence.jdbc.password" value="somePassword"/>
      </properties>
   </persistence-unit>

The test case is persisting a MockEntity object with an ID and a Date, no SomeNumber is set

MockEntity testEntity = new MockEntity();
testEntity.setMyId(999999l);
testEntity.setSomeDate(new Date());

When I use the ojdbc14.jar with an Oracle 10g database, my junit gets the following error

Caused by: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into (“SOME_TABLE”.”SOME_NUMBER”)

When I use ojdbc14.jar with an Oracle 11g database, my junit completes successfully. The row exists in the table.

I’ve attempted to use the ojbc5.jars in hopes of having this issue disappear, but no luck.

Does Oracle 10g interpret the Hibernate generated sql:

insert into SOME_TABLE (ID, SOME_NUMBER, SOME_DATE) values (?, ?, ?)

where the there is a null in the parameter passed to the statement differently than 11g, and how can I get the expected results on 10g?

  • 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-26T07:17:25+00:00Added an answer on May 26, 2026 at 7:17 am

    @axtavt was correct…the schema’s were different. Egg on my face for not beginning my troubleshooting at the source!

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have a reasonable size flat file database of text documents mostly saved in
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a bunch of posts stored in text files formatted in yaml/textile (from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites 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.