79374891

Date: 2025-01-21 15:01:48
Score: 2.5
Natty:
Report link

I'm having - as it seems - exactly the same issue. Some details:

Java: 8
Oracle JDBC Driver 8: 19.3.0.0

My Sequence looks like:

Increment By    1
Last Cached Value   100100541
Minimum Value   0
Maximum Value   999999999999999999999999999
Cache Size  20
Cycle   No
Order   No
Keep    No
Scale   No
Extend  No
Session/Global  Global
Sharded No

I'm inserting ~33k records in batches into my Oracle DB. Most of the records work fine (~33'500) and some (~7'200) return a very large negative number (such as -449800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000).

The database contains the right values generated.

My code looks (roughly for simplification) like this:

 try (PreparedStatement ps = connection.prepareStatement(INSERT_STMT, GENERATED_COLUMN_INDEXES)){
     // initialize data per prepared statement
     for(...){
        ps.setString(...);... 
        preparedStatement.addBatch();
     }
     
     preparedStatement.executeBatch();
     
     ResultSet generatedKeys = ps.getGeneratedKeys()) {
     if (generatedKeys.next()) {
         BigDecimal generatedKey = generatedKeys.getBigDecimal(GENERATED_COLUMN_INDEX);
         ...
     }
    
 }

Any thought on how to fix this?

Thanks so much!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • RegEx Blacklisted phrase (1.5): how to fix this?
  • Long answer (-1):
  • Has code block (-0.5):
  • Ends in question mark (2):
Posted by: Sebastian