MVCC=true, multi-thread and ReentrantLock

2013-02-26 Thread Noel Grandin

HI

Since we now require Java1.5, perhaps we should be using

 java.util.concurrent.locks.ReentrantLock(true/*fair*/)

  (note  the use of the fairness parameter.)

instead of using the synchronized keyword?

I suspect it would reduce the incidence of  "Timeout trying to lock 
table" when using MVCC mode, because we'd be executing the incoming 
queries in the order in which they arrived, instead of in semi-random order.


Personally, I don't use MVCC or MULTI_THREADED, so I'm not inclined to 
pursue this, but other people seem to be using those modes, so maybe 
they'd like to try?


Regards,
Noel Grandin

Specifically, in the code I talking about here lives in 
org.h2.command.Command


public int executeUpdate() {
Object sync = database.isMultiThreaded() ? (Object) session : 
(Object) database;


synchronized (sync) {
   
}
}

private long filterConcurrentUpdate(DbException e, long start) {
   
database.wait(sleep);
   
}


and in org.h2.table.RegularTable

private void doLock(Session session, int lockMode, boolean exclusive) {
   
database.wait(sleep);
   
}

and in org.h2.mvstore.db.MVTable#doLock(Session session, int lockMode, 
boolean exclusive)

and in org.h2.mvstore.db.MVStore.Writer#run()



--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Exposing some getter methods and classes for TableEngine implementors

2013-02-26 Thread Noel Grandin


On 2013-02-27 01:14, Ashwin Jayaprakash wrote:


*Issue 1: *This seems alright except for the deepest join on c where 
the predicate (c.type = 'answers') _does not get pushed down_ in the 
TableFilter.getFilterCondition() for "c" where it is null.


Patches are welcome.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Exposing some getter methods and classes for TableEngine implementors

2013-02-26 Thread Ashwin Jayaprakash
I have something to add to my previous request. For a moderately complex 
query like this:

select *a*.id, *a*.age, b.id, *c*.id, *c***.type
from *a* 
  left outer join *b* on a.id = b.id
  left outer join *c* on b.id = c.id 
where *a*.age < 42 and *c*.type = 'answers'

Here, a.id, b.id, c.id are all indexed columns.

While executing this query, the database does a nested loop join of:
   a (age < 42) *[* b (b.id = current a.id) *[* c (c.id = current b.id) *]* 
*]*

*Issue 1: *This seems alright except for the deepest join on c where the 
predicate (c.type = 'answers') *does not get pushed down* in the 
TableFilter.getFilterCondition() for "c" where it is null.

*Issue 2:* The second thing is more of an enhancement request where the *
TableFilter.fullCondition* does not have a *getter method*. It would be 
nice if we had one for that. If this were available then issue 1 could be 
somewhat alleviated if we had visibility into the overall/full condition. 
This way TableEngine implementors can do some early optimizations.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How to check existence of cached temp table

2013-02-26 Thread Vineela Gampa

Thanks Steve. That works.
On Thursday, 14 February 2013 22:51:04 UTC-8, Steve McLeod wrote:
>
> As follows:
>
> create cached temp table if not exists foobar ;
>
> select count(*) from information_schema.tables 
> where 
>   table_schema = 'PUBLIC' 
>   and table_type = 'TABLE' 
>   and storage_type = 'GLOBAL TEMPORARY'
>   and table_name = 'FOOBAR';
>
> If the select query returns 1, then the temporary table called FOOBAR 
> exists.
>
>
> On Friday, 15 February 2013 12:39:33 UTC+11, Vineela Gampa wrote:
>>
>> Hi
>>
>> I have a table which i create using the statement "create cached temp 
>> table if not exists"
>>
>> I want to check if this temp table exists. How can i do so ? 
>>
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Timeout trying to lock table ; SQL statement: [90131-168]

2013-02-26 Thread srinivas upadhya
Hi Noel,

I had posted this on one more 
forum: 
http://h2-database.66688.n3.nabble.com/MVCC-and-SELECT-FOR-UPDATE-td2140527.html
Thats because i thought this & the other one isn't related. And it was 
supposed to be a question for the person who had replied to that post.
Sorry for that. Will delete / cross post if possible.

Regards,
Srinivas

On Tuesday, February 26, 2013 7:49:53 PM UTC+5:30, Noel Grandin wrote:
>
>  Please don't post the same question twice, it just annoys the people here 
> and makes us less likely to help you.
>
> On 2013-02-26 15:37, srinivas upadhya wrote:
>  
> Hi, 
>
> We are getting this exception on trying to insert to a table: 
>
>  
>  

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Have composite index T(a,b): is index T(a) redundant?

2013-02-26 Thread Dan Halbert
I have a table like this:
  CREATE TABLE t (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY(a, b))

This implicitly creates an index:
  CREATE INDEX t(a, b)

To improve the efficiency of some queries, I have also created an index:
  CREATE INDEX t(b)

Is it worth also creating an non-composite index on a?
  CREATE INDEX t(a)

or is INDEX t(a) redundant and subsumed by CREATE INDEX t(a, b)?

Thanks,
Dan

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Timeout trying to lock table ; SQL statement: [90131-168]

2013-02-26 Thread Noel Grandin
Please don't post the same question twice, it just annoys the people 
here and makes us less likely to help you.


On 2013-02-26 15:37, srinivas upadhya wrote:

Hi,

We are getting this exception on trying to insert to a table:



--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: MVCC and SELECT FOR UPDATE

2013-02-26 Thread srinivas

Hi,

We are getting this exception on trying to insert to a table:

insert into materials (id, a, b, c, d, e, f) values (null, ?, ?, ?, ?, ?,
'a') [50200-168]; nested exception is org.h2.jdbc.JdbcSQLException: Timeout
trying to lock table ; SQL statement:
insert into materials (id, a, b, c, d, e, f) values (null, ?, ?, ?, ?, ?,
'a') [50200-168]
at
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
at
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at
org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
at
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:379)
at
org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:645)
at com.x.MaterialRepository.save(MaterialRepository.java:281)
at 
com.x.MaterialRepository.findOrCreateFrom(MaterialRepository.java:317)
at
com.x.MaterialDatabaseUpdater.folderFor(MaterialDatabaseUpdater.java:140)
at
com.x.MaterialDatabaseUpdater.initializeMaterialWithLatestRevision(MaterialDatabaseUpdater.java:102)
at
com.x.MaterialDatabaseUpdater.access$000(MaterialDatabaseUpdater.java:30)
at
com.x.MaterialDatabaseUpdater$1.doInTransaction(MaterialDatabaseUpdater.java:73)
at
com.x.transaction.TransactionCallback.doWithExceptionHandling(TransactionCallback.java:8)
at
com.x.transaction.TransactionTemplate$3.doInTransaction(TransactionTemplate.java:37)
at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
at
com.x.transaction.TransactionTemplate.executeWithExceptionHandling(TransactionTemplate.java:33)
at
com.x.MaterialDatabaseUpdater.updateMaterial(MaterialDatabaseUpdater.java:71)
at 
com.x.MaterialUpdateListener.onMessage(MaterialUpdateListener.java:27)
at 
com.x.MaterialUpdateListener.onMessage(MaterialUpdateListener.java:12)
at
com.x.messaging.activemq.JMSMessageListenerAdapter.runImpl(JMSMessageListenerAdapter.java:49)
at
com.x.activemq.JMSMessageListenerAdapter.run(JMSMessageListenerAdapter.java:34)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.h2.jdbc.JdbcSQLException: Timeout trying to lock table ; SQL
statement:
insert into materials (id, a, b, c, d, e, f) values (null, ?, ?, ?, ?, ?,
'a') [50200-168]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
at org.h2.command.Command.filterConcurrentUpdate(Command.java:276)
at org.h2.command.Command.executeUpdate(Command.java:232)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:156)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:142)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at
org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at
org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656)
at
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at
org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at
org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.imp

Re: Physical disconnection caused h2 to grow as big as possible

2013-02-26 Thread Riccard Montén
OK - Thank you Noel!


From: Noel Grandin 
Sent: Tuesday, February 26, 2013 11:11 AM
To: Riccard Montén ; h2-database@googlegroups.com 
Subject: Re: Physical disconnection caused h2 to grow as big as possible


Yes, it is normally handled by the transaction log. 
Normally, what happens is that all of the data does not get to the disk.
In which case we use our transaction/undo log to undo all in-progress 
modifications.

However, in your case it looks like the actual header of the DB was corrupted, 
and there is not much we can do about that.

The header now contains a bad value which makes the DB look much bigger than it 
should bes, and the RECOVER process is failing when it tries to expand the DB 
to that size.


On 2013-02-26 12:05, Riccard Montén wrote:

  Yes it seems hard to repair! I succeeded to open the db-file in MS Wordpad so 
I could save some data. 
  Just two questions: 
  Normally should not a physical diconnection be handled in by h2 minimizing 
the effect of such a crash?
  Is it possible to know what makes the size of the databasefile to grow as big 
as it can limited only by the physical diskspace?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Physical disconnection caused h2 to grow as big as possible

2013-02-26 Thread Noel Grandin

Yes, it is normally handled by the transaction log.
Normally, what happens is that all of the data does not get to the disk.
In which case we use our transaction/undo log to undo all in-progress 
modifications.


However, in your case it looks like the actual header of the DB was 
corrupted, and there is not much we can do about that.


The header now contains a bad value which makes the DB look much bigger 
than it should bes, and the RECOVER process is failing when it tries to 
expand the DB to that size.


On 2013-02-26 12:05, Riccard Montén wrote:
Yes it seems hard to repair! I succeeded to open the db-file in MS 
Wordpad so I could save some data.

Just two questions:
Normally should not a physical diconnection be handled in by h2 
minimizing the effect of such a crash?
Is it possible to know what makes the size of the databasefile to grow 
as big as it can limited only by the physical diskspace?


--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: h2 with Eclipselink and sequences

2013-02-26 Thread Noel Grandin


Yeah, at this point you're probably better off asking on the Eclipselink 
mailing list.


Weird, I would have thought H2 would be well supported because Eclipse 
uses it internally.


On 2013-02-26 11:35, Dries wrote:
Because, once I enable my sessionCustomizer class, eclipselink no 
longer uses the correct statement (CALL NEXT VALUE FOR), but instead 
uses :


[EL Fine]: 2013-02-22

14:50:01.291--ClientSession(2052114141)--Connection(1340006540)--Thread(Thread[main,5,main])--UPDATE
SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [50, SYSTEM_SEQUENCE_1E71BBBC_0444_4E1D_A3A5_DD4483BD30EE]


All I changed in the session Customizer class was setSequenceNumberName.

I came up with a workaround where I now, instead of using auto 
increment when creating the tables, I createmy own sequences and set 
the default value of the column to :
"DEFAULT (NEXT VALUE FOR PUBLIC.MY_SEQUENCE_TABNAME ) NOT NULL 
NULL_TO_DEFAULT SEQUENCE PUBLIC.MY_SEQUENCE_TABNAME";


Then in my persistence entity classes, I set the sequence name.
@GeneratedValue(strategy = GenerationType.AUTO, generator="GEN_TABNAME")
@SequenceGenerator(name = "GEN_TABNAME", sequenceName = 
"MY_SEQUENCE_TABNAME", allocationSize = 1)



It's not ideal, I would still prefer a way where eclipselink figures 
out the sequence name of an auto_increment field and uses that 
correctly, but it works.




--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: h2 with Eclipselink and sequences

2013-02-26 Thread Dries
Because, once I enable my sessionCustomizer class, eclipselink no longer 
uses the correct statement (CALL NEXT VALUE FOR), but instead uses : 

[EL Fine]: 2013-02-22 
14:50:01.291--ClientSession(2052114141)--Connection(1340006540)--Thread(Thread[main,5,main])--UPDATE
 
SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ?
bind => [50, SYSTEM_SEQUENCE_1E71BBBC_0444_4E1D_A3A5_DD4483BD30EE]


All I changed in the session Customizer class was setSequenceNumberName.

I came up with a workaround where I now, instead of using auto increment 
when creating the tables, I createmy own sequences and set the default 
value of the column to :
"DEFAULT (NEXT VALUE FOR PUBLIC.MY_SEQUENCE_TABNAME ) NOT NULL 
NULL_TO_DEFAULT SEQUENCE PUBLIC.MY_SEQUENCE_TABNAME";

Then in my persistence entity classes, I set the sequence name.
@GeneratedValue(strategy = GenerationType.AUTO, generator="GEN_TABNAME")
@SequenceGenerator(name = "GEN_TABNAME", sequenceName = 
"MY_SEQUENCE_TABNAME", allocationSize = 1)


It's not ideal, I would still prefer a way where eclipselink figures out 
the sequence name of an auto_increment field and uses that correctly, but 
it works.

Thanks,

Droes

On Tuesday, February 26, 2013 10:25:01 AM UTC+1, Noel Grandin wrote:
>
>  
> On 2013-02-22 15:55, Dries wrote:
>  
> I'm able to make that statement work on the correct tables and fields in 
> h2, but h2 doesn't allow changes to meta tables, so that doesn't solve the 
> problem either. 
> login.getPlatform().setSequenceCounterFieldName("CURRENT_VALUE");
> login.getPlatform().setSequenceNameFieldName("SEQUENCE_NAME");
> login.getPlatform().setSequenceTableName("INFORMATION_SCHEMA.SEQUENCES");
> login.getPlatform().setSequencePreallocationSize(1);
>  
>   [EL Fine]: 2013-02-22 
> 14:52:15.602--ClientSession(1205789719)--Connection(1834774659)--Thread(Thread[main,5,main])--UPDATE
>  
> INFORMATION_SCHEMA.SEQUENCES SET CURRENT_VALUE = CURRENT_VALUE + ? WHERE 
> SEQUENCE_NAME = ?
>   bind => [1, SYSTEM_SEQUENCE_1E71BBBC_0444_4E1D_A3A5_DD4483BD30EE]
>  
>
>  
>  That statement is not allowed because it updates meta tables.
>
>  
>  
> Why are you trying to update meta tables instead of using standard SQL to 
> modify the sequence?
>
> http://h2database.com/html/grammar.html#alter_sequence
>  

-- 
*
*
*

Confidentiality Notice:  *
The information in this email is confidential and privileged.  If you are 
the intended recipient and you have a current Non-Disclosure Agreement in 
place between your entity and Security Weaver any content contained or 
implied by this email should be considered within the scope of that 
agreement.  If the recipient of this message is not the intended recipient, 
any disclosure, copying, distribution, retention or action taken or omitted 
to be taken in reliance on it is prohibited.  Please notify us immediately 
by replying to the message or by telephoning +1- 800-620-4210 and deleting 
it and any attachments from your computer system.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: h2 with Eclipselink and sequences

2013-02-26 Thread Dries
I don't use Schema Generation by eclipselink, the tables are created in h2 
directly.  That I think is the reason h2 isn't able to link the sequence 
name to the auto_increment field.

On Tuesday, February 26, 2013 7:31:19 AM UTC+1, Christoph Läubrich wrote:
>
> Do you use annotations? Schema generation? 
>
> I use H2 with eclipse link and the following annotation for id: 
>
> @Id 
> @GeneratedValue(strategy = GenerationType.IDENTITY) 
>
> without any problem (schema is generated by eclipse link) 
>

-- 
*
*
*

Confidentiality Notice:  *
The information in this email is confidential and privileged.  If you are 
the intended recipient and you have a current Non-Disclosure Agreement in 
place between your entity and Security Weaver any content contained or 
implied by this email should be considered within the scope of that 
agreement.  If the recipient of this message is not the intended recipient, 
any disclosure, copying, distribution, retention or action taken or omitted 
to be taken in reliance on it is prohibited.  Please notify us immediately 
by replying to the message or by telephoning +1- 800-620-4210 and deleting 
it and any attachments from your computer system.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: h2 with Eclipselink and sequences

2013-02-26 Thread Noel Grandin


On 2013-02-22 15:55, Dries wrote:
I'm able to make that statement work on the correct tables and fields 
in h2, but h2 doesn't allow changes to meta tables, so that doesn't 
solve the problem either.

login.getPlatform().setSequenceCounterFieldName("CURRENT_VALUE");
login.getPlatform().setSequenceNameFieldName("SEQUENCE_NAME");
login.getPlatform().setSequenceTableName("INFORMATION_SCHEMA.SEQUENCES");
login.getPlatform().setSequencePreallocationSize(1);

[EL Fine]: 2013-02-22

14:52:15.602--ClientSession(1205789719)--Connection(1834774659)--Thread(Thread[main,5,main])--UPDATE
INFORMATION_SCHEMA.SEQUENCES SET CURRENT_VALUE = CURRENT_VALUE + ?
WHERE SEQUENCE_NAME = ?
bind => [1, SYSTEM_SEQUENCE_1E71BBBC_0444_4E1D_A3A5_DD4483BD30EE]



That statement is not allowed because it updates meta tables.




Why are you trying to update meta tables instead of using standard SQL 
to modify the sequence?


http://h2database.com/html/grammar.html#alter_sequence

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Physical disconnection caused h2 to grow as big as possible

2013-02-26 Thread Noel Grandin
I'm sorry, but your H2 database was corrupted beyond the abilities of 
the Recover tool to deal with.


On 2013-02-22 23:45, PetitPo wrote:

I´ve been using h2 as db with OOBase as GUI for some years.
With some SQL-knowledge I can handle what I need mostly. I´m not an 
experienced programmer and I know no java.


Recently I have been testing a new database with URL: 
jdbc:h2:\F:\KULT\KULT;AUTO_SERVER=TRUE

for some days. I have the files on a USB-stick.
The db have 4 main tables and 4 forms and had around 200 rows in the 
biggest table when the problem started.


While working today I touched the USBstick unvoluntarily with the 
effect that the data I was
registrering could not be saved because of I/O-problems and I couldn´t 
close either h2 or Base
untilWindows interfered and "wanted to to fix the files". I did not 
allow that since I have bad
experience of thoose actions before and afterwordsI could close the 
both softwares.


When trying to open h2 again it was impossible because "the disk 
(=USBstiock) was too small".
The h2.db that earlier was smallewr than 3 MB now had grown to 3,3 GB 
which was as much as it could grow.
It had filled the USB-stick so it was impossible to open. I Copied the 
file and pasted it to C: and immediately it
filled ehat was empty of C: and had grown to 411 GB and it was still 
impossible to open.


When trying to recover the file the Recovering tool can`t find the file.

I have tried to find information in h2database.com.
I need an understanding of what have happened and if it is possible to 
rescue the data and where to find

information on how to do that. Error message below.

PetitPo

The Error message h2 produces when trying to connect is as follows:
The Swedish in the first rows says that there is not enough space on disk.

IO Exception: "java.io.IOException: Det finns inte tillräckligt med 
utrymme på disken"; "F:\KULT\KULT.h2.db" [90031-159] 
 
90031/90031 (Help) 

org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.IOException: Det 
finns inte tillräckligt med utrymme på disken"; "F:\KULT\KULT.h2.db" 
[90031-159]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329 
) 

at org.h2.message.DbException.get(DbException.java:158 
) 

at org.h2.message.DbException.convertIOException(DbException.java:315 
) 

at org.h2.store.FileStore.setLength(FileStore.java:401 
) 

at org.h2.store.PageStore.increaseFileSize(PageStore.java:1156 
) 

at org.h2.store.PageStore.increaseFileSize(PageStore.java:1147 
) 

at org.h2.store.PageStore.getFreeList(PageStore.java:1051 
) 

at org.h2.store.PageStore.getFreeListForPage(PageStore.java:1038 
) 

at org.h2.store.PageStore.allocatePage(PageStore.java:1078 
) 

at 
org.h2.store.PageInputStream.allocateAllPages(PageInputStream.java:153 
) 

at org.h2.store.PageLog.recover(PageLog.java:259 
) 

at org.h2.store.PageStore.recover(PageStore.java:1327 
) 

at org.h2.store.PageStore.openExisting(PageStore.java:349 
) 

at org.h2.store.PageStore.open(PageStore.java:273 
) 

at org.h2.engine.Database.getPageStore(Database.java:2049 
) 

at org.h2.engine.Database.open(Database.java:553 
) 

at org.h2.engine.Database.openDatabase(Database.java:220 
) 

at org.h2.engine.Database.(Database.java:215 


Re: java.lang.ArrayIndexOutOfBoundsException

2013-02-26 Thread Noel Grandin

Need the entire exception please, this is just part of it.

On 2013-02-22 20:19, Cesar Rodriguez wrote:

Hi,

After de Recovery, still have the 
"java.lang.ArrayIndexOutOfBoundsException" error:


Query:

SELECT * FROM PACIENTE ORDER BY ID_PACIENTE DESC;

Response:

General error: "java.lang.ArrayIndexOutOfBoundsException"; SQL statement:
SELECT * FROM PACIENTE ORDER BY ID_PACIENTE DESC [5-170] 
 HY000/5 
(Help) 

org.h2.jdbc.JdbcSQLException: General error: 
"java.lang.ArrayIndexOutOfBoundsException"; SQL statement:

SELECT * FROM PACIENTE ORDER BY ID_PACIENTE DESC [5-170]
at 
org.h2.message.DbException.getJdbcSQLException(DbException.java:329 
)
at org.h2.message.DbException.get(DbException.java:158 
)
at org.h2.message.DbException.convert(DbException.java:281 
)
at org.h2.command.Command.executeQuery(Command.java:195 
)
at 
org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:173 
)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:152 
)
at org.h2.server.web.WebApp.getResult(WebApp.java:1311 
)
at org.h2.server.web.WebApp.query(WebApp.java:1001 
)
at org.h2.server.web.WebApp$1.next(WebApp.java:964 
)
at org.h2.server.web.WebApp$1.next(WebApp.java:953 
)
at org.h2.server.web.WebThread.process(WebThread.java:166 
)
at org.h2.server.web.WebThread.run(WebThread.java:93 
)

at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ArrayIndexOutOfBoundsException
--
You received this message because you are subscribed to the Google 
Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to h2-database+unsubscr...@googlegroups.com.

To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.