This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How Websphere 9 restart fixes database exception?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using websphere 9, Java (ejb) application(jpa 2.0). I got an intermittent issue "org.apache.openjpa.peraistence.PersistenceException DB2 SQLError =-530 , SQLSTATE =-23503 error

And not able to save.
But after restart my server from websphere console, the error gone. After few hours the error will be back..How server restart fix a database exception?
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Rohit!

Unfortunately, IBM's DB2 error codes can be particularly useless. What would serve us better is if you could copy-and-paste the stack trace of that failure from your DB2 log to this message thread. Please do a text copy, not a screen shot!
 
Rohit Sam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Org.apache.openjpa.jdbc.sql.DBDirectory.narrow(DBDictionary.java:4998)
at Org.apache.openjpa.jdbc.sql.DBDirectory.newstoreexception(DBDictionary.java:571)
at Org.apache.openjpa.jdbc.sql.QLExceptions.getStore(SQLExceptions.java:136)
at Org.apache.openjpa.jdbc.sql.QLExceptions.getStore(SQLExceptions.java:78)
at org.apache.openjp.jdbc.kernal.PreparedStatementManagerImpl.flushAndupdate(PreparedStatementManagerImpl.java:144)
org.apache.openjp.jdbc.kernal.PreparedStatementManagerImpl.lushInternal(PreparedStatementManagerImpl.java:100)
org.apache.openjp.jdbc.kernal.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:88)
org.apache.openjp.jdbc.kernal.OperarionOrderUpdateManager.flushPrimaryRow(OperationOrderUpdateManager.java:203)
org.apache.openjp.jdbc.kernal.OperarionOrderUpdateManager.flush(OperationOrderUpdateManager.java:89)
org.apache.openjp.jdbc.kernal.abstractUpdateManager.flush(AbstractUpdateManager.java:105)
org.apache.openjp.jdbc.kernal.abstractUpdateManager.flush(AbstractUpdateManager.java:78)
org.apache.openjp.jdbc.kernal.elegatingStoreManager.flush(DelegatingStoreManager.java:131)
INSERT INTO TABLE(TESTNO,ADDEDBY,UPDATEDBY,CURRENTTIME,MODIFYTIME)VALUES(?,?,?,?,?)
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!

The DB2 error codes you got are explained here: https://www.sqlerror.de/db2_sql_error_-530_sqlstate_23503.html

Basically, it says that you are attempting to insert a new row into TABLE, but there's a foreign key value in that data that has no corresponding value in the foreign table.

That's a bug in the database logic. The foreign table needs to have that value added before the data can be added to TABLE.
 
Rohit Sam
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. but how it fix after restarting the server. It is working fine without any issue for some hours. And issue came back and again fix after restart the server
 
Tim Holloway
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Possibly because you had a pending commit for the foreign table that got posted when you shut the system down so that when it tried to insert again the foreign key was now already in the database.

It's still a bug in the application program, regardless.
 
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic