Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERXSequence throwing exception #330

Closed
ijazfx opened this issue Nov 25, 2012 · 1 comment
Closed

ERXSequence throwing exception #330

ijazfx opened this issue Nov 25, 2012 · 1 comment

Comments

@ijazfx
Copy link
Contributor

ijazfx commented Nov 25, 2012

I've updated my wonder to latest. The application that was running fine all of a sudden seems to be broken. I'm getting following exception what getting a DatabaseSequence object.

This is the line of the code:

new ERXSequence.DatabaseSequence(editingContext(), "MyModel", "VisaApplicationProcessNumber");

and below is the exception.

Caused by: com.webobjects.foundation.NSForwardException [org.postgresql.util.PSQLException] No results were returned by the query.:Error fetching sequence: VisaApplicationProcessNumber
at er.extensions.eof.ERXSequence$DatabaseSequence.increasedMaxValue(ERXSequence.java:227)
at er.extensions.eof.ERXSequence.nextValue(ERXSequence.java:65)

... 75 more

Caused by: org.postgresql.util.PSQLException: No results were returned by the query.
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:255)
at er.extensions.eof.ERXSequence$DatabaseSequence.selectAndUpdateValue(ERXSequence.java:168)
at er.extensions.eof.ERXSequence$DatabaseSequence.increasedMaxValue(ERXSequence.java:210)
... 80 more

Here is the database query:

qshield=> select * from erx_sequence_table;
name_ | value_
------------------------------+----------
VisaApplicationProcessNumber | 2777

The fix for this is following:

I've debugged ERXSequence.java and found that following statement is causing problem:

168: con.createStatement().executeQuery(updateStatement);

Since updateStatement does not return any result, it throws exception. I changed this with following which fixed the issue:

168: con.createStatement().executeUpdate(updateStatement);

@darkv
Copy link
Member

darkv commented Nov 26, 2012

fixed in master and integration branch

@darkv darkv closed this as completed Nov 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants