Chas Douglass | 1 Jul 17:32 2005
Picon

Hiberate 3.0

I'm trying to use Hibernate for the first time, so of course I picked 
the latest release 3.0.

It appears the Mckoi conflicts in previous releases have been fixed.  At 
any rate, I don't have the problems previously mentioned.  The error I 
get is:
      [java] 08:20:44,741 ERROR JDBCTransaction:104 - JDBC commit failed
      [java] com.mckoi.database.jdbc.MSQLException: Concurrent 
Serializable Trans
action Conflict(2): Table altered/dropped: AuctionUser
      [java]     at 
com.mckoi.database.jdbc.RemoteDatabaseInterface.execQuery(Rem
oteDatabaseInterface.java:280)
      [java]     at 
com.mckoi.database.jdbc.MConnection.executeQuery(MConnection.
java:453)
      [java]     at 
com.mckoi.database.jdbc.MConnection.executeQueries(MConnectio
n.java:436)
      [java]     at 
com.mckoi.database.jdbc.MStatement.executeQueries(MStatement.
java:193)
      [java]     at 
com.mckoi.database.jdbc.MStatement.executeQuery(MStatement.ja
va:167)
      [java]     at 
com.mckoi.database.jdbc.MStatement.executeQuery(MStatement.ja
va:222)
      [java]     at 
com.mckoi.database.jdbc.MConnection.commit(MConnection.java:6
(Continue reading)

James | 3 Jul 03:17 2005
Picon

RE: Hibernate 3.0

Mckoi has serializable isolation level which can give
unexpected behavior if you are used to read commited
isolation.

If a connection is sitting in a connection pool for a
period of time keep in mind that it is actually in a
transaction that started with the last
commit/rollback.  This in turn means that it has and
is working on an image of the database as existed at
the end of that last transaction, when it was used by
a previous Hibernate session object.

So, I don't know if a Hibernate session object, upon
creation, does a commit/rollback on it's connection
before proceeding to do whatever it is going to do. 
If it doesn't, then the image of the database it is
working on could be rather old--seconds or minutes or
more.  If the schema has been changed in the mean
time, by another connection, then upon a commit there
will be a Serializable Transaction Conflict.

At least this is my understanding, so please correct
if anyone disagrees.

Jim

---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-unsubscribe <at> mckoi.com

(Continue reading)

Chas Douglass | 6 Jul 16:29 2005
Picon

Re: Hibernate 3.0

I should have mentioned I'm trying to get the Hibernate example to work. 
  I set the DB properties for Mckoi.  It gets this error after creating 
the sample tables and when it attempts to insert some test data.

Chas Douglass

James wrote:
> Mckoi has serializable isolation level which can give
> unexpected behavior if you are used to read commited
> isolation.
> 
> If a connection is sitting in a connection pool for a
> period of time keep in mind that it is actually in a
> transaction that started with the last
> commit/rollback.  This in turn means that it has and
> is working on an image of the database as existed at
> the end of that last transaction, when it was used by
> a previous Hibernate session object.
> 
> So, I don't know if a Hibernate session object, upon
> creation, does a commit/rollback on it's connection
> before proceeding to do whatever it is going to do. 
> If it doesn't, then the image of the database it is
> working on could be rather old--seconds or minutes or
> more.  If the schema has been changed in the mean
> time, by another connection, then upon a commit there
> will be a Serializable Transaction Conflict.
> 
> At least this is my understanding, so please correct
> if anyone disagrees.
(Continue reading)

James | 7 Jul 06:11 2005
Picon

Re: Hibernate 3.0

>I should have mentioned I'm trying to get Hibernate
>example to work. I set the DB properties for Mckoi.  
>It gets this error after creating the sample tables 
>and when it attempts to insert some test data.
Yes , the error is possible if you are using a
connection pool.

Are you using a connection pool?  Or is it a single
connection?  (If the pool can be set to max. 1
connection it would be good to try it that way)

Are you using Hibernate in Spring?  If so, try using
DriverManagerDataSource like bean below and let me
know if it works.

<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property
name="driverClassName"><value>com.mckoi.JDBCDriver</value></property>
<property
name="url"><value>jdbc:mckoi://localhost:9001/APP/≤/value></property>
<property name="username"><value></value></property>
<property name="password"><value></value></property>
</bean>

---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-unsubscribe <at> mckoi.com

(Continue reading)

James | 7 Jul 22:25 2005
Picon

RE: Hibernate 3.0

After thinking about this more, as I should have, I
see that Spring is not in the equation.

I finally decided to install version 3 of Hibernate
and see what's up.

I see the exception that you see.  

In hibernate.properties I tried setting isolation to
serializable but still saw exception.

hibernate.connection.isolation 8

What seems to stop the exception was to uncomment
following:
hibernate.connection.autocommit true

This 'fix' is consistent with what I was saying.  If
commits are happening for every update, insert and
delete then connections in a pool would have 'image'
of the database refreshed more often too.

Having made this change you will now see a different
exception:

ERROR JDBCExceptionReporter:72 - Lexical error at line
1, column 329.  Encountered: "\"" (34), after : "."

What Mckoi does NOT like is the quotes on column names
like so: 
(Continue reading)

James | 7 Jul 23:56 2005
Picon

RE: Hibernate 3.0

>When I get a chance I am going to follow-up this 
>issue with Hibernate forum to see if a fix is 
>possible for Mckoi db.
Sorry for being ambiguious.  The issue, I was
referring to is the chances a "Serializable
Transaction Conflict" can occur.  It may be possible
to reduce chance of such conflicts, in connection
pooled environments.

---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-unsubscribe <at> mckoi.com

Chas Douglass | 8 Jul 02:53 2005
Picon

Re: Hibernate 3.0

Thanks for the effort and the explicit instructions.

I followed them, and got the example to work.  Now I can proceed with my 
own application of Hibernate.

Thanks again!

Chas Douglass

James wrote:
> After thinking about this more, as I should have, I
> see that Spring is not in the equation.
> 
> I finally decided to install version 3 of Hibernate
> and see what's up.
> 
> I see the exception that you see.  
> 
> In hibernate.properties I tried setting isolation to
> serializable but still saw exception.
> 
> hibernate.connection.isolation 8
> 
> What seems to stop the exception was to uncomment
> following:
> hibernate.connection.autocommit true
> 
> This 'fix' is consistent with what I was saying.  If
> commits are happening for every update, insert and
> delete then connections in a pool would have 'image'
(Continue reading)

James | 10 Jul 21:06 2005
Picon

Hibernate 3.0 used with serializable isolation DB

Here is the posted Hibernate forum message.

  http://forum.hibernate.org/viewtopic.php?t=944864

I'm waiting for feedback and any is appreciated.

This forum message has my implementation of solution
to reduce odds of 'concurrent serializable transaction
conflict' occurring, in a connection pooled
environment.

The solution is to cause an explicit connection commit
or rollback to occur at the beginning of every
Hibernate transaction--I.e. when
Session.beginTransaction() is called.  This ensures
that the connection associated with Hibernate session
is working with the freshest possible image/view of
the database schema, before it does any work.  (This
is implemented by extending JDBCTransaction and
overriding begin() method)

I've tried transaction class on Hibernate example
'build eg'--with Mckoi--and the example completes
successfully.

Note: that setting /etc/hibernate.properties
autocommit to true it not an acceptable 'fix'. 
Usually there are multiple insert/update/delete
statements within a single Hibernate transaction.  If
the connection is autocommit=true, then each DML
(Continue reading)

Arjav Chakravarti | 10 Jul 22:44 2005
Picon

Moved position out of bounds error

Hi,

	I'm using Mckoi 1.0.3 on 64-bit Linux and sometimes get an error
when creating a database. The database creation works most of the time,
but occasionally it will fail and give me the following stack trace. I
was hoping someone could let me know what was going on.

Thanks,
Arjav

[com.mckoi.debug.Debug - Exception thrown: 'Moved position out of
bounds.']
java.io.IOException: Moved position out of bounds.
        at
com.mckoi.store.AbstractStore$StoreArea.position(AbstractStore.java:1571
)
        at
com.mckoi.database.IndexSetStore$IndexBlock.<init>(IndexSetStore.java:13
00)
        at
com.mckoi.database.IndexSetStore.addIndexLists(IndexSetStore.java:440)
        at
com.mckoi.database.V2MasterTableDataSource.create(V2MasterTableDataSourc
e.java:349)
        at
com.mckoi.database.TableDataConglomerate.createMasterTable(TableDataCong
lomerate.java:3187)
        at
com.mckoi.database.Transaction.createTable(Transaction.java:461)
        at
(Continue reading)

Arjav Chakravarti | 12 Jul 15:18 2005
Picon

RE: Moved position out of bounds error

My original message mentioned this as being a problem during database
creation. However, it occurs during database updates as well. The stack
trace I see is as follows.

Thanks,
Arjav

[com.mckoi.debug.Debug - Exception thrown: 'Moved position out of
bounds.']
java.io.IOException: Moved position out of bounds.
        at
com.mckoi.store.AbstractStore$StoreArea.position(AbstractStore.java:1571
)
        at
com.mckoi.database.IndexSetStore$IndexBlock.<init>(IndexSetStore.java:13
00)
        at
com.mckoi.database.IndexSetStore.commitIndexSet(IndexSetStore.java:626)
        at
com.mckoi.database.V2MasterTableDataSource.commitIndexSet(V2MasterTableD
ataSource.java:1235)
        at
com.mckoi.database.MasterTableDataSource.commitTransactionChange(MasterT
ableDataSource.java:720)
        at
com.mckoi.database.TableDataConglomerate.processCommit(TableDataConglome
rate.java:2946)
        at
com.mckoi.database.Transaction.closeAndCommit(Transaction.java:2068)
        at
(Continue reading)


Gmane