Discussion:
Hibernate 3.0
James
2005-07-03 01:17:47 UTC
Permalink
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-***@mckoi.com
Chas Douglass
2005-07-06 14:29:16 UTC
Permalink
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
Post by James
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/
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
James
2005-07-07 04:11:22 UTC
Permalink
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-***@mckoi.com
James
2005-07-07 20:25:18 UTC
Permalink
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:
, bids1_."datetime" as datetime5_1_1_
, user2_."password" as password3_2_2_
, user2_."initial" as initial6_2_2_

You can see the offending sql by uncommenting
property:
hibernate.show_sql true

You can stop the quotes from being applied by changing
the hbm.xml files of Bid and User classes. Just
remove the back-ticks surrounding datetime, initial
and password property column attributes. See
following:

<property name="datetime" not-null="true"
column="`datetime`"/>

<property name="initial"
column="`initial`"/>

<property name="password" not-null="true" length="15"
column="`password`"/>

(I've written about this before on this forum.)

After applying these changes, "build eg" should
execute successfully.

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. I have an idea as to what to do.

Jim



---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
Chas Douglass
2005-07-08 00:53:26 UTC
Permalink
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
Post by James
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
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
ERROR JDBCExceptionReporter:72 - Lexical error at line
1, column 329. Encountered: "\"" (34), after : "."
What Mckoi does NOT like is the quotes on column names
, bids1_."datetime" as datetime5_1_1_
, user2_."password" as password3_2_2_
, user2_."initial" as initial6_2_2_
You can see the offending sql by uncommenting
hibernate.show_sql true
You can stop the quotes from being applied by changing
the hbm.xml files of Bid and User classes. Just
remove the back-ticks surrounding datetime, initial
and password property column attributes. See
<property name="datetime" not-null="true"
column="`datetime`"/>
<property name="initial"
column="`initial`"/>
<property name="password" not-null="true" length="15"
column="`password`"/>
(I've written about this before on this forum.)
After applying these changes, "build eg" should
execute successfully.
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. I have an idea as to what to do.
Jim
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com

James
2005-07-07 21:56:13 UTC
Permalink
Post by James
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-***@mckoi.com
Loading...