Hi,

I think transactions can be rolled back if the server is stopped during a
transaction. That case can't be easily solved (well, with the MVStore it
might be possible at some point).

As for exception "Remote connections to this server are not allowed": it's
the wrong exception, this needs to be changed, but I'm not sure to what
other exception (maybe "transaction is rolled back?"). The best solution
would be if the database would be smart enough to handle that case. I just
don't know yet how to do it... One idea is to re-use the random id in the
.lock.db file as the mac salt. But I'm not sure how easy that is.

Regards,
Thomas


On Thu, Sep 18, 2014 at 8:47 PM, Kenton Garner <[email protected]>
wrote:

> OK, Lets see if I can make it simple from my perspective.  I understand
> that this could happen.  So in the event of an exception when reading the
> CLOB I will retry the query.
>    - I will not get a new database connection - because it comes from a
> connection pool and H2 internal should already handle that.
>    - I will call conn.createStatement(); and start off with a fresh
> statement object and retry the query and re-read from the
> resultSet.getClob() method.
>
> I still have one question though.  Is it save to limit myself to retrying
> only the one exception that contains the "-tcpAllowOthers" phrase, or
> should I retry once for any and all exceptions?
>
> Thanks.
>
>
> On Thursday, September 18, 2014 2:31:48 PM UTC-4, Thomas Mueller wrote:
>>
>> Hi,
>>
>> I can reproduce the problem and found out what the reason is. When you
>> close the database in (A), the internal TCP server was stopped. The second
>> connection (B) then re-opened the database, but the remote connection had a
>> LOB HMAC, which is no longer valid.
>>
>> It's quite tricky to fix. The problem is that the LOB MAC salt needs to
>> be per database... Not sure how to do that best...
>>
>> Regards,
>> Thomas
>>
>>
>> OS: Solaris 10
>>> JVM: 1.7.0_45
>>> H2: 1.4.181
>>> BoneCP ( Connection Pool )
>>>
>>> I am running in Automatic mixed mode with the following connection url...
>>> jdbc:h2:../data/audit;COMPRESS=TRUE;AUTOCOMMIT=ON;
>>> MVCC=TRUE;DB_CLOSE_ON_EXIT=FALSE;MV_STORE=FALSE;AUTO_
>>> SERVER=TRUE;AUTO_SERVER_PORT=8701
>>>
>>> I have two Java applications both accessing one H2 database file.  By
>>> definition, the first application started (A) runs the H2 database as
>>> embedded and the second (B) connects via port 8701.
>>> This does and has worked fine - up until today.
>>>
>>> Today the first application (A) started shutdown while the second (B)
>>> was in the process of reading a CLOB from the H2 database.
>>> This second (B) application failed to read the CLOB and threw the
>>> "Remote connections to this server are not allowed" exception ( see below ).
>>>
>>> 1. What is the suggested way of handling this exception (It is obviously
>>> not "remote" as it is running on the same host) ?
>>> 2. Should this exception just be swallowed and have the application
>>> retry this query on its own?
>>> 3. Is this function of interrupting the CLOB read?  Could this happen on
>>> other queries?
>>>
>>>
>>> Caused by: java.io.IOException: org.h2.message.DbException: Remote
>>>> connections to this server are not allowed, see -tcpAllowOthers [90117-181]
>>>> at org.h2.message.DbException.convertToIOException(DbException.java:364)
>>>>
>>>> at org.h2.store.LobStorageRemoteInputStream.read(
>>>> LobStorageRemoteInputStream.java:73)
>>>> at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
>>>> at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
>>>> at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
>>>> at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
>>>> at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
>>>> at java.io.InputStreamReader.read(InputStreamReader.java:184)
>>>> at java.io.BufferedReader.read1(BufferedReader.java:203)
>>>> at java.io.BufferedReader.read(BufferedReader.java:279)
>>>> at java.io.BufferedReader.fill(BufferedReader.java:154)
>>>> at java.io.BufferedReader.read1(BufferedReader.java:205)
>>>> at java.io.BufferedReader.read(BufferedReader.java:279)
>>>> at java.io.Reader.read(Reader.java:140)
>>>> at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2001)
>>>> at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1980)
>>>> at com.issinc.cds.sbsend.mfwd.proc.MessageForwardMessageRouter.
>>>> saveImpl(MessageForwardMessageRouter.java:197)
>>>> at com.issinc.cds.sbsend.mfwd.proc.MessageForwardMessageRouter.
>>>> saveFinalizedFormat(MessageForwardMessageRouter.java:168)
>>>> at com.issinc.cds.sbsend.mfwd.proc.MessageForwardMessageRouter.
>>>> processRequest(MessageForwardMessageRouter.java:90)
>>>> at com.issinc.cds.sbsend.input.poller.MessageForwardDirPollerRenamer
>>>> $1.ProcessData(MessageForwardDirPollerRenamer.java:110)
>>>> ... 5 more
>>>>
>>>> Caused by: org.h2.message.DbException: Remote connections to this
>>>> server are not allowed, see -tcpAllowOthers [90117-181]
>>>> at org.h2.message.DbException.convert(DbException.java:283)
>>>> at org.h2.engine.SessionRemote.done(SessionRemote.java:629)
>>>> at org.h2.engine.SessionRemote.readLob(SessionRemote.java:778)
>>>> at org.h2.store.LobStorageRemoteInputStream.read(
>>>> LobStorageRemoteInputStream.java:71)
>>>> ... 23 more
>>>>
>>>> Caused by: org.h2.jdbc.JdbcSQLException: Remote connections to this
>>>> server are not allowed, see -tcpAllowOthers [90117-181]
>>>> at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
>>>>
>>>> at org.h2.message.DbException.get(DbException.java:179)
>>>> at org.h2.message.DbException.get(DbException.java:155)
>>>> at org.h2.message.DbException.get(DbException.java:144)
>>>> at org.h2.value.Transfer.verifyLobMac(Transfer.java:764)
>>>> at org.h2.server.TcpServerThread.process(TcpServerThread.java:445)
>>>> at org.h2.server.TcpServerThread.run(TcpServerThread.java:159)
>>>> at java.lang.Thread.run(Thread.java:744)
>>>>
>>>> at org.h2.engine.SessionRemote.done(SessionRemote.java:622)
>>>> ... 25 more
>>>>
>>>
>>>
>>>  --
>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to