• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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: 28485
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: 28485
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: 28485
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.
 
Crusading Chameleon likes the size of this ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic