[ 
https://issues.apache.org/jira/browse/OPENJPA-1367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806810#action_12806810
 ] 

Milosz Tylenda commented on OPENJPA-1367:
-----------------------------------------

Prashant, I have applied your patch into 2.0.x branch, with slight 
modifications:
- Removed a few variable assignments in H2Dictionary since DBDictionary already 
assigns the same values to them.
- Modified a bit SQL error codes file. A caveat here is the difference between 
SQL state and SQL error code. It is handled by DBDictionary.matchErrorState 
method which uses SQL states to determine exception type unless the method is 
overriden. I found some H2 source file [1] helpful here.

As for org.apache.openjpa.persistence.sequence.TestSequence, it is failing 
because of a deadlock in INSERT statement. I believe this is because H2 uses 
table level locking and this test executes a lot of parallel inserts into two 
tables. I also ran the test with MVCC option turned on in H2 which is supposed 
to use row level locking but I ended up with OutOfMemoryError (although I only 
tried in-memory database). Anyway having only one test failing in 
openjpa-persistence-jdbc module is a very good result.

Unfortunately I am currently not familiar with internals of 
openjpa-peristence-locking tests and do not have enough time to dig into them 
now. As you have noted in your attachment, the results are better with MVCC 
option turned on. I can only guess that the tests fail mainly due to different 
locking semantics in H2 than the tests assume.

I am going to apply the patch also to the 1.3.x branch and then mark the issue 
resolved. If you would like to continue work on the mentioned failing tests, 
please open a new issue.


Thomas, thank you for pointing the CROSS JOIN issue. The patch applied contains 
the fix.


[1] http://kickjava.com/src/org/h2/message/Message.java.htm


> H2 Database Engine does support cross join
> ------------------------------------------
>
>                 Key: OPENJPA-1367
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1367
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: docs, jpa
>    Affects Versions: 1.2.1, 2.0.0-M1
>            Reporter: Thomas Mueller
>            Assignee: Milosz Tylenda
>            Priority: Minor
>         Attachments: OPENJPA-1367.patch, openjpa-h2-test-results.txt
>
>
> The documentation says that the H2 database does not support cross joins:
> http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/dbsupport_h2.html
> http://openjpa.apache.org/builds/2.0.0-M3/apache-openjpa-2.0.0-M3/docs/manual/main.html
> H2 does support cross join since a long time (I don't remember what version). 
> See: http://www.h2database.com/html/grammar.html#table_expression (CROSS). A 
> condition is not required for cross join.
> I think the documentation should be changed, and probably the H2Dictionary 
> should be changed as well (crossJoinClause = "CROSS JOIN"; 
> requiresConditionForCrossJoin = false;).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to