Re: Updating 2 derby tables

2017-05-20 Thread John English
On 19/05/2017 23:13, Bob M wrote: Message: Column 'TRADE_NO_TEMP2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER

Re: Identity column and 40XL1 error

2017-05-20 Thread Abhirama
Hello Rick, With your guidance I was able to dig more into the problem. IDENTITY_VAL_LOCAL() is not being issued by hibernate but by Derby itself. Hibernate does use getGeneratedKeys. When it issues getGeneratedKeys(), the call is being directed to public final java.sql.ResultSet

Re: Identity column and 40XL1 error

2017-05-20 Thread Rick Hillegas
Hi Abhi, Thanks for investigating further. You have uncovered a defect in Derby's implementation of Statement.getGeneratedKeys(). The defect must have been introduced when we re-implemented identity columns on top of sequence generators. I have reproduced the problem which you are seeing and

Re: Identity column and 40XL1 error

2017-05-20 Thread Rick Hillegas
Hi Abhi, Here is one more idea. I believe that you said that you are running an in-memory database. That means that you do not need to worry about leaking pre-allocated sequence numbers when your application exits. You can try setting the pre-allocation range to the maximum number with the

Re: Updating 2 derby tables

2017-05-20 Thread Bob M
Hi John Hint: it's always a good idea to give names to your constraints and suchlike, so that the error message will refer to a name that appears in your DB schema, rather than a system-generated name like SQL170412104646890. If you can't figure out which is the violated constraint referred to in

Re: Updating 2 derby tables

2017-05-20 Thread Bob M
Hi John Understanding a bit more now... I see when I look at the key to table2 it has the identifier 'SQL170412104645890' as stated in the error message -- View this message in context: http://apache-database.10148.n7.nabble.com/Updating-2-derby-tables-tp147386p147410.html Sent

Re: Updating 2 derby tables

2017-05-20 Thread Bob M
Inserted newest record:- Trading_Date/Trading_Time: 2016-1-11, 12 Oldest record:- Trading_Date/Trading_Time: 2012-02-06, 6 Deleted oldest record Adding a new trade record Number: 4101 - SQLException - SQL State: 23505 Error Code: 2 Message: The statement was aborted because it

Re: Updating 2 derby tables

2017-05-20 Thread Bob M
Hi John Trade_no_temp2 is a variable I do not understand why the error message relates this variable to a table? Bob M -- View this message in context: http://apache-database.10148.n7.nabble.com/Updating-2-derby-tables-tp147386p147408.html Sent from the Apache Derby Users mailing list