db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: data lost with ij
Date Fri, 30 Oct 2009 13:30:08 GMT
Hi François,

Your data will disappear on exit if you don't commit after the insert in 
the second ij script.

Hope this helps,
-Rick

RAPPAZ Francois wrote:
> I use to file called with the run command in ij
> 1 file says:
> AUTOCOMMIT OFF;
>
> CREATE TABLE authors (
> 	name1 varchar(20) NOT NULL,
> 	name2 varchar(20) NOT NULL,
> 	data varchar(50),
> 	auhtor_id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY
1)
> );
>
> CREATE INDEX name ON AUTHORS (name1, name2);
>
> ALTER TABLE authors
>    ADD CONSTRAINT authors_pk Primary Key (
>       author_id);
>
> COMMIT;
>
> 2 file contains the insert statement and nothing else.
> Is this the problem ?
>
> François
>
>
>   
>> -----Original Message-----
>> From: Richard.Hillegas@Sun.COM [mailto:Richard.Hillegas@Sun.COM]
>> Sent: vendredi, 30. octobre 2009 14:10
>> To: Derby Discussion
>> Subject: Re: data lost with ij
>>
>> RAPPAZ Francois wrote:
>>     
>>> Using ij, I create a database, then I build a table and populate it
>>>       
>> with a serie of insert statement. Without doing anything else I
>> disconnect (that take a long time) and I exit.
>>     
>>> When I reconnect and run a select * from table; I got nothing in the
>>>       
>> table...
>>     
>>> If run that select statement after the inserts, the bug does not
>>>       
>> appear.
>>     
>>> Is this a known problem ?
>>>
>>> François
>>>
>>>       
>> Hi François,
>>
>> It sounds as though you are not committing your transaction before
>> exiting. As part of an orderly exit, make sure that you do the
>> following:
>>
>> 1) Commit your transaction
>>
>> 2) Shutdown the database
>>
>> 3) Then exit
>>
>> Hope this helps,
>> -Rick
>>     


Mime
View raw message