data lost with ij

View: New views
6 Messages — Rating Filter:   Alert me  

data lost with ij

by RAPPAZ Francois :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: data lost with ij

by Kristian Waagan-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 ?
>  

Hello,

It is not a know problem that data disappear if you committed the
transaction.
A few starting points:
  - Was autocommit on? If not, did you commit the transaction?
  - Are you sure you're connecting to the same database?
  - Are you connecting to the database using the same user name?
    (the user name determines the default schema)

You may also want to read derby.log, and maybe enable SQL statement text
logging to see what's going on.


Regards,
--
Kristian
> François
>  


Re: data lost with ij

by Rick Hillegas-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

RE: data lost with ij

by RAPPAZ Francois :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... [mailto:Richard.Hillegas@...]
> 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

Re: data lost with ij

by Rick Hillegas-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... [mailto:Richard.Hillegas@...]
>> 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
>>    


RE: data lost with ij

by RAPPAZ Francois :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That was it: putting autocommit on; at the end of my first script correct the problem
I copy the script from one of the example...

My mistake, sorry.
François

> -----Original Message-----
> From: Richard.Hillegas@... [mailto:Richard.Hillegas@...]
> Sent: vendredi, 30. octobre 2009 14:30
> To: Derby Discussion
> Subject: Re: data lost with ij
>
> 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@... [mailto:Richard.Hillegas@...]
> >> 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
> >>