Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2017-01-02 Thread Anatolii K
I created separate topic for this bug 
https://groups.google.com/forum/#!topic/h2-database/rhSoRhzeZzk

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-22 Thread Anatolii K
Please try attached test. It fails after 10-60 seconds run

org.h2.jdbc.JdbcSQLException: General error: 
"java.lang.IllegalStateException: File corrupted in chunk 28, expected page 
length 4..32, got -1621686845 [1.4.193/6]"; SQL statement:
update account set balance = ? where id = ? [5-193]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.command.Command.executeUpdate(Command.java:266)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:201)
at Bug_H2_4$Arte.call(Bug_H2_4.java:99)
at Bug_H2_4$Arte.call(Bug_H2_4.java:82)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: File corrupted in chunk 28, 
expected page length 4..32, got -1621686845 [1.4.193/6]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:766)
at org.h2.mvstore.Page.read(Page.java:649)
at org.h2.mvstore.Page.read(Page.java:195)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1952)
at org.h2.mvstore.MVMap.readPage(MVMap.java:738)
at org.h2.mvstore.Page.getChildPage(Page.java:217)
at org.h2.mvstore.MVMap.binarySearch(MVMap.java:470)
at org.h2.mvstore.MVMap.binarySearch(MVMap.java:471)
at org.h2.mvstore.MVMap.binarySearch(MVMap.java:471)
at org.h2.mvstore.MVMap.get(MVMap.java:452)
at 
org.h2.mvstore.db.TransactionStore$TransactionMap.getValue(TransactionStore.java:1203)
at 
org.h2.mvstore.db.TransactionStore$TransactionMap.get(TransactionStore.java:1180)
at 
org.h2.mvstore.db.TransactionStore$TransactionMap.get(TransactionStore.java:1148)
at org.h2.mvstore.db.MVPrimaryIndex.getRow(MVPrimaryIndex.java:215)
at org.h2.mvstore.db.MVTable.getRow(MVTable.java:463)
at 
org.h2.mvstore.db.MVSecondaryIndex$MVStoreCursor.get(MVSecondaryIndex.java:489)
at org.h2.index.IndexCursor.get(IndexCursor.java:288)
at org.h2.table.TableFilter.get(TableFilter.java:594)
at org.h2.command.dml.Update.update(Update.java:109)
at org.h2.command.CommandContainer.update(CommandContainer.java:98)



On Thursday, December 22, 2016 at 2:36:35 PM UTC+5, Thomas Mueller Graf 
wrote:
>
> Hi,
>
> I didn't see a failure either.
>
> Regards,
> Thomas
>
>
> On Thu, Dec 22, 2016 at 10:13 AM, Noel Grandin  > wrote:
>
>>
>>
>> On 2016/12/21 7:24 PM, Anatolii K wrote:
>>
>>> Test attached
>>>
>>>
>> Are you definitely testing with the latest HEAD? Because I ran your test 
>> for 10 minutes without problems.
>>
>> On 64-bit JDK 1.8.0_111
>>
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to h2-da...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


public class Bug_H2_4 {

static String dbUrl = "jdbc:h2:nioMemLZF:db;DB_CLOSE_DELAY=-1;MULTI_THREADED=1;LOCK_TIMEOUT=1;WRITE_DELAY=500";
static String user = "sa", pwd = "";
static int threadCount = 200;

public static void main(String args[]) throws InterruptedException, SQLException {
Arte[] artes = new Arte[threadCount];
Connection dbConnect;
try {
Class.forName("org.h2.Driver");
dbConnect = DriverManager.getConnection(dbUrl, user, pwd);
DbPreparator.prepareScheme(dbConnect);
System.out.println("DB scheme prepared");

DbPreparator.populate(dbConnect);
System.out.println("DB populated");

for (int i = 0; i < threadCount; i++) {
artes[i] = new Arte(DriverManager.getConnection(dbUrl, user, pwd));
}
System.out.println("ARTEs created");
} catch (ClassNotFoundException | SQLException e) {
System.out.println("DB Connection Failed: " + dbUrl);
e.printStackTrace();
   

Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-22 Thread Thomas Mueller Graf
Hi,

I didn't see a failure either.

Regards,
Thomas


On Thu, Dec 22, 2016 at 10:13 AM, Noel Grandin 
wrote:

>
>
> On 2016/12/21 7:24 PM, Anatolii K wrote:
>
>> Test attached
>>
>>
> Are you definitely testing with the latest HEAD? Because I ran your test
> for 10 minutes without problems.
>
> On 64-bit JDK 1.8.0_111
>
>
> --
> 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 https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-22 Thread Noel Grandin



On 2016/12/21 7:24 PM, Anatolii K wrote:

Test attached



Are you definitely testing with the latest HEAD? Because I ran your test for 10 
minutes without problems.

On 64-bit JDK 1.8.0_111

--
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Anatolii K
Test attached

On Wednesday, December 21, 2016 at 8:41:44 PM UTC+5, Thomas Mueller Graf 
wrote:
>
> Hi,
>
> I guess that bug would be on my plate... I recently made changes there 
> (trying to improve concurrency). I'm sorry about that. Having a test case 
> would be great!
>
> Regards,
> Thomas
>
>
>
> On Wed, Dec 21, 2016 at 3:56 PM, Noel Grandin  > wrote:
>
>> Can we get a full stack trace for that failure.​
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to h2-da...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Bug_H2_4 {

static String dbUrl = "jdbc:h2:nioMemLZF:db;DB_CLOSE_DELAY=-1;MULTI_THREADED=1 ";
static String user = "sa", pwd = "";
static int threadCount = 100;

public static void main(String args[]) throws InterruptedException, SQLException {
Arte[] artes = new Arte[threadCount];
Connection dbConnect;
try {
Class.forName("org.h2.Driver");
dbConnect = DriverManager.getConnection(dbUrl, user, pwd);
DbPreparator.prepareScheme(dbConnect);
System.out.println("DB scheme prepared");

DbPreparator.populate(dbConnect);
System.out.println("DB populated");

for (int i = 0; i < threadCount; i++) {
artes[i] = new Arte(DriverManager.getConnection(dbUrl, user, pwd));
}
System.out.println("ARTEs created");
} catch (ClassNotFoundException | SQLException e) {
System.out.println("DB Connection Failed: " + dbUrl);
e.printStackTrace();
return;
}

ExecutorService threadPool = Executors.newFixedThreadPool(threadCount);
for (int i = 0; i < threadCount; i++) {
threadPool.submit(artes[i]);
}

while (true) {
Thread.sleep(100);
}
}

static class DbPreparator {

public static final int OBJ_CNT = 1;
private static final String[] SQLs = new String[]{
"CREATE TABLE IF NOT EXISTS "
+ "ACCOUNT (\n"
+ "	ID NUMBER(18,0) not null PRIMARY KEY,\n"
+ "	BALANCE NUMBER null)\n"
};

public static void prepareScheme(Connection db) throws SQLException {
for (String sql : SQLs) {
db.createStatement().execute(sql);
db.commit();
}
}

public static void populate(Connection db) throws SQLException {
PreparedStatement mergeAcctStmt = db.prepareStatement("MERGE INTO Account(id, balance) key (id) VALUES (?, ?)");
for (int i = 0; i < OBJ_CNT; i++) {
mergeAcctStmt.setLong(1, i);
mergeAcctStmt.setBigDecimal(2, BigDecimal.ZERO);
mergeAcctStmt.addBatch();
}
mergeAcctStmt.executeBatch();
db.commit();
}
}

static class Arte implements Callable {

Connection db;
PreparedStatement updateAcctStmt;

public Arte(Connection db_) throws SQLException {
db = db_;
db.setAutoCommit(false);
updateAcctStmt = db.prepareStatement("UPDATE account set balance = ? where id = ?");
}

@Override
public Integer call() {
try {
while (true) {
updateAcctStmt.setDouble(1, Math.random());
updateAcctStmt.setLong(2, (int) (Math.random() * DbPreparator.OBJ_CNT));
updateAcctStmt.execute();
db.commit();
}
} catch (SQLException e) {
System.out.println("DB write error: ");
e.printStackTrace();
System.exit(0);
}
return null;
}
}

}


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Anatolii K
org.h2.jdbc.JdbcSQLException: General error: 
"java.nio.BufferUnderflowException"; SQL statement:
UPDATE account set balance = ? where id = ? [5-193]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.command.Command.executeUpdate(Command.java:266)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:201)
at org.radixware.imdb_test.Arte.updateAcct(Arte.java:137)
at org.radixware.imdb_test.Arte.call(Arte.java:68)
at org.radixware.imdb_test.Arte.call(Arte.java:11)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:500)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:249)
at org.h2.compress.CompressLZF.expand(CompressLZF.java:427)
at org.h2.store.fs.FileNioMemData.expand(FilePathNioMem.java:555)
at org.h2.store.fs.FileNioMemData.readWrite(FilePathNioMem.java:659)
at org.h2.store.fs.FileNioMem.read(FilePathNioMem.java:332)
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:421)
at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
at org.h2.mvstore.Page.read(Page.java:190)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1959)
at org.h2.mvstore.MVMap.readPage(MVMap.java:800)
at org.h2.mvstore.Page.getChildPage(Page.java:217)
at org.h2.mvstore.Cursor.min(Cursor.java:129)
at org.h2.mvstore.Cursor.hasNext(Cursor.java:36)
at 
org.h2.mvstore.db.TransactionStore$TransactionMap$1.fetchNext(TransactionStore.java:1221)
at 
org.h2.mvstore.db.TransactionStore$TransactionMap$1.(TransactionStore.java:1217)
at 
org.h2.mvstore.db.TransactionStore$TransactionMap.keyIterator(TransactionStore.java:1212)
at 
org.h2.mvstore.db.TransactionStore$TransactionMap.keyIterator(TransactionStore.java:1200)
at org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:309)
at org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:254)
at org.h2.index.BaseIndex.find(BaseIndex.java:128)
at org.h2.index.IndexCursor.find(IndexCursor.java:169)
at org.h2.table.TableFilter.next(TableFilter.java:467)
at org.h2.command.dml.Update.update(Update.java:102)
at org.h2.command.CommandContainer.update(CommandContainer.java:98)
at org.h2.command.Command.executeUpdate(Command.java:258)
... 8 more


On Wednesday, December 21, 2016 at 7:57:41 PM UTC+5, Noel Grandin wrote:
>
> Can we get a full stack trace for that failure.​
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Anatolii K
The bug is reproduced only in multi-thread application

On Wednesday, December 21, 2016 at 8:41:44 PM UTC+5, Thomas Mueller Graf 
wrote:
>
> Hi,
>
> I guess that bug would be on my plate... I recently made changes there 
> (trying to improve concurrency). I'm sorry about that. Having a test case 
> would be great!
>
> Regards,
> Thomas
>
>
>
> On Wed, Dec 21, 2016 at 3:56 PM, Noel Grandin  > wrote:
>
>> Can we get a full stack trace for that failure.​
>>
>> -- 
>> 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...@googlegroups.com .
>> To post to this group, send email to h2-da...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Thomas Mueller Graf
Hi,

I guess that bug would be on my plate... I recently made changes there
(trying to improve concurrency). I'm sorry about that. Having a test case
would be great!

Regards,
Thomas



On Wed, Dec 21, 2016 at 3:56 PM, Noel Grandin  wrote:

> Can we get a full stack trace for that failure.​
>
> --
> 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 https://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Noel Grandin
Can we get a full stack trace for that failure.​

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Anatolii K
Without split it also failed (url  jdbc:h2:nioMemLZF:db):

Caused by: java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:500)

On Wednesday, December 21, 2016 at 7:50:31 PM UTC+5, Noel Grandin wrote:
>
> then let's fix that problem, but I'm not really keen on trying to fix a 
> combination crash like that. 
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Noel Grandin

then let's fix that problem, but I'm not really keen on trying to fix a 
combination crash like that.

--
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Anatolii K
I have very big in-memory database ~ 1TB. Without split H2 crashes 


On Wednesday, December 21, 2016 at 7:43:13 PM UTC+5, Noel Grandin wrote:
>
> I'm sorry, but that's just a silly combination to be using. 
>
> You should only using be "split:" for FAT filesystems, and you should 
> certainly not be using it in combination with 
> "nioMemLZF:" 
>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Noel Grandin

I'm sorry, but that's just a silly combination to be using.

You should only using be "split:" for FAT filesystems, and you should certainly not be using it in combination with 
"nioMemLZF:"


--
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Anatolii K
After applying this patch I'm getting following error with nioMemLZF 
(url= jdbc:h2:split:30:nioMemLZF:db):

org.h2.jdbc.JdbcSQLException: General error: 
"java.nio.BufferUnderflowException"; SQL statement:
UPDATE account set balance = ? where id = ? [5-193]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convert(DbException.java:295)
at org.h2.command.Command.executeUpdate(Command.java:266)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:201)
at org.radixware.imdb_test.Arte.updateAcct(Arte.java:137)
at org.radixware.imdb_test.Arte.call(Arte.java:68)
at org.radixware.imdb_test.Arte.call(Arte.java:11)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:500)
at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:249)
at org.h2.compress.CompressLZF.expand(CompressLZF.java:427)
at org.h2.store.fs.FileNioMemData.expand(FilePathNioMem.java:555)
at org.h2.store.fs.FileNioMemData.readWrite(FilePathNioMem.java:659)
at org.h2.store.fs.FileNioMem.read(FilePathNioMem.java:332)
at org.h2.store.fs.FileSplit.read(FilePathSplit.java:296)
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:421)
at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
at org.h2.mvstore.Page.read(Page.java:190)
at org.h2.mvstore.MVStore.readPage(MVStore.java:1952)
at org.h2.mvstore.MVMap.readPage(MVMap.java:738)
at org.h2.mvstore.Page.getChildPage(Page.java:217)
at org.h2.mvstore.MVMap.binarySearch(MVMap.java:470)
at org.h2.mvstore.MVMap.binarySearch(MVMap.java:471)
at org.h2.mvstore.MVMap.get(MVMap.java:452)


On Wednesday, December 21, 2016 at 4:01:40 PM UTC+5, Anatolii K wrote:
>
> Thank you for quick help!
>
> On Wednesday, December 21, 2016 at 3:55:32 PM UTC+5, Noel Grandin wrote:
>>
>> It appears I was wrong about this, we already implement reading/writing 
>> without synchronisation for all of our other 
>> file implementations, I just missed that you are using the "split:" 
>> stuff. 
>>
>> I have pushed a fix for this. 
>>
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Anatolii K
Thank you for quick help!

On Wednesday, December 21, 2016 at 3:55:32 PM UTC+5, Noel Grandin wrote:
>
> It appears I was wrong about this, we already implement reading/writing 
> without synchronisation for all of our other 
> file implementations, I just missed that you are using the "split:" stuff. 
>
> I have pushed a fix for this. 
>

-- 
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-21 Thread Noel Grandin
It appears I was wrong about this, we already implement reading/writing without synchronisation for all of our other 
file implementations, I just missed that you are using the "split:" stuff.


I have pushed a fix for this.

--
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.


Re: [h2] Concurrency at org.h2.store.fs.FileBase.read()

2016-12-20 Thread Noel Grandin
Not without changing the structure considerably - FileBase inherits from java.nio.channels.FileChannel, which has a 
position field, and multiple things changing that at the same time would cause problems.


We'd probably need to switch to using Java's asynchronous IO API to avoid that, 
which is a fairly large change.

You're welcome to submit patches, of course :-)

--
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.