Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink Test suite and Ingres
EclipseLink Test suite and Ingres [message #381667] Tue, 30 September 2008 00:33 Go to next message
Usha Rajsekar is currently offline Usha RajsekarFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,

Running eclipselink foundation SRG tests against Ingres results in the
following syntax error. I was wondering how to tell the EclipseLink
framework that keywords such as CASCADE or RESTRICT must be followed by
the ALTER TABLE statement for Ingres. i.e for example:

ALTER TABLE SALARY DROP CONSTRAINT FK_SALARY_EMP_ID CASCADE

Which DatabasePlatform interface method need to be implemented in
IngresPlatform.java so that EclipseLink framework knows that these
keywords need to be used with Ingres for the ALTER TABLE DML statement? OR
is there any other configuration that I am missing?

Eclipselink foundation core tests (ant test-core) seems to have run
succesfully.

Any pointers appreciated.

Regards,
Usha

snippet from test-results.xml:

Call: ALTER TABLE SALARY DROP CONSTRAINT FK_SALARY_EMP_ID
Query: DataModifyQuery()
[EL Warning]: 2008.09.29
19:35:04.143--DatabaseSessionImpl(1377187)--Exception [EclipseLink-4002]
(Eclipse Persistence Services - 1.0 (Build SNAPSHOT-20080929)):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.ingres.gcf.util.SqlEx: line 1, Syntax error on
'EOF'. The correct syntax is:
ALTER TABLE tablename
ADD [CONSTRAINT constraint_name] constraint_clause
| DROP CONSTRAINT constraint_name RESTRICT | CASCADE
| ADD [COLUMN] columnname format [default_clause] [null_clause]
[column_constraint]
| DROP [COLUMN] column_name RESTRICT | CASCADE
| ALTER [COLUMN] columnname format [default_clause] [null_clause]
Error Code: 3850
Re: EclipseLink Test suite and Ingres [message #381672 is a reply to message #381667] Tue, 30 September 2008 15:27 Go to previous messageGo to next message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
There is a method getConstraintDeletionString() on DatabasePlatform that
lets you customize the DROP CONSTRAINT, but does not seem to allow
anything written after the constraint name. You may need to add a new
DatabasePlatform method getConstraintPostDeletionString() in the
FieldDefinition (org.eclipse.persistence.tools.schemaframework).

-- James
Re: EclipseLink Test suite and Ingres [message #381674 is a reply to message #381672] Wed, 01 October 2008 00:44 Go to previous messageGo to next message
Usha Rajsekar is currently offline Usha RajsekarFriend
Messages: 8
Registered: July 2009
Junior Member
Thanks James. I think I got this working... But I hit another syntax issue
with reference to Ingres: "For Update NOWAIT" in "select" queries.

Ingres Syntax:
==============

* help sql select\g
Executing . . .


The syntax of a SELECT statement is:

subselect { UNION [ALL] (subselect) }
[ ORDER BY column [ASC|DESC] {, column [ASC|DESC] } ]

where a subselect has the syntax:

SELECT [ALL|DISTINCT] expression [AS column] {,expression [AS
column]}
FROM from_clause
[ WHERE search_condition]
[ GROUP BY column {, column} ]
[ HAVING search_condition ]

and a from_clause has either the syntax:
tablename [corr_name] {, tablename [corr_name] }

or the syntax:
tablename [corr_name] {[INNER | LEFT | RIGHT | FULL] JOIN
tablename [corr_name] ON search_condition}

Note: UNION [ALL] is not supported by Open SQL.

Examples:
select pno, sno from sp;

select x.pno, y.sno from p x, s y
where x.color='red';

select sum(qty), pno
from sp
where sno != 's1'
group by pno;

continue
*

Query recieved by the Ingres JDBC driver from Eclipselink:
===========================================================

Prep[7418]: 'SELECT ADDRESS_ID, CITY, COUNTRY, P_CODE, PROVINCE, STREET
FROM ADDRESS WHERE (ADDRESS_ID = ?) FOR UPDATE OF ADDRESS_ID NOWAIT'
DrvPrep[7420]: preparing statement 'SELECT ADDRESS_ID, CITY, COUNTRY,
P_CODE, PROVINCE, STREET FROM ADDRESS WHERE (ADDRESS_ID = ?) FOR UPDATE OF
ADDRESS_ID NOWAIT'
Msg[0]: begin message QUERY
Msg[0]: sending message QUERY length 151 EOD EOG
Msg[0]: check TL data
Msg[0]: received message ERROR length 122 EOD
DrvPrep[7420]: Received error '42000' 0xa11 -- line 1, Syntax error on
'NOWAIT'.
Ingres-PreparedStatement[7418]: error preparing statement
Exception: 42000, 0xa11
Message: line 1, Syntax error on 'NOWAIT'.

Any pointers on eliminating "NOWAIT", and "FOR UPDATE OF" in "SELECT" for
Ingres is greatly appreciated.

Regards,
Usha
Re: EclipseLink Test suite and Ingres [message #381675 is a reply to message #381674] Wed, 01 October 2008 13:20 Go to previous messageGo to next message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
You can set the NO_WAIT syntax in the DatabasePlatform method,
getSelectForUpdateNoWaitString(). If Ingres does not support NO_WAIT,
then you could just return the normal FOR UPDATE, or throw a
NotSupportedException.

In general the tests run a lot of tests that are specific to certain
databases, or that are not supported on certain database. They will
typically throw or log a warning if the platform does not support the
test. The select for update tests already check for several unsupported
platforms, so you could just change these tests to not run on Ingres.

-- James
Re: EclipseLink Test suite and Ingres [message #381678 is a reply to message #381675] Fri, 03 October 2008 18:21 Go to previous messageGo to next message
Usha Rajsekar is currently offline Usha RajsekarFriend
Messages: 8
Registered: July 2009
Junior Member
James,

Thanks again for all your prompt replies. I think that I have taken care
of all the Ingres SQL syntax issues while running the eclipselink
foundation core tests (ant test-core, ant test-core-srg) from the
eclipselink base directory. The test-core ouptut messages are here for
your reference:
( http://community.ingres.com/w/files/d/d9/Eclipselink_test-co re.txt) and
the tests appear to hang for some unknown reasons to me. Errors that
particularly make me wonder are: "Duplicate INSERT" and Primary key being
null. The test-results.xml file is empty as the test didn't run to
completion.

As you had mentioned the tests were written for certain databases it is
not clear to me why the foundation core tests hang when running against
Ingres. The revised IngresPlatform.java file is available at
http://community.ingres.com/w/files/3/33/IngresPlatform_upda ted.txt in
case if you need.

I would appreciate any pointers to get the core-SRG tests run to
completion so that I will have an idea about how many tests passed. Am I
missing any test configurations?

Regards,
Usha
Re: EclipseLink Test suite and Ingres [message #381680 is a reply to message #381678] Mon, 06 October 2008 14:19 Go to previous messageGo to next message
James is currently offline JamesFriend
Messages: 272
Registered: July 2009
Senior Member
If it is hanging you will need to debug it and figure out which test is
failing. I would start by running the SRG, before trying the LRG. If the
LRG is hanging you can either enable logging to finest to see in which
test/model the hang occurs. Or you can run the tests from Eclipse in
debug mode and pause the thread when it hangs to see what is occurring.
You can also launch the test-browser either from EclipseLink or through
ant, this will let you run the tests one by one, so you can determine
which tests pass/fail/hang.

There are some tests which we only run on Oracle because they use a high
amount of concurrency, and some other databases can deadlock. You may
need to disable these tests from running on Ingres.
Re: EclipseLink Test suite and Ingres [message #382800 is a reply to message #381680] Tue, 04 November 2008 16:13 Go to previous messageGo to next message
Doug Clarke is currently offline Doug ClarkeFriend
Messages: 155
Registered: July 2009
Senior Member
I have create an enhancement request to track this issue. Once we have the
clean test run we can work on integrating the platform.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=253682

Please attach the database platform you created to this bug.

Doug
Re: EclipseLink Test suite and Ingres [message #382801 is a reply to message #382800] Tue, 04 November 2008 19:08 Go to previous messageGo to next message
Usha Rajsekar is currently offline Usha RajsekarFriend
Messages: 8
Registered: July 2009
Junior Member
Thanks Doug.I will attach the initial version of the DatabasePlatform file
for Ingres to the bug id that you have created for tracking purpose.

I was also wondering if someone familiar with Eclipselink and test suites
of Eclipselink can give a presentation during upcoming Eclipse DemoCamp
event happening in Redwood City.

Regards,
Usha
Re: EclipseLink Test suite and Ingres [message #382802 is a reply to message #382800] Tue, 04 November 2008 19:27 Go to previous messageGo to next message
Usha Rajsekar is currently offline Usha RajsekarFriend
Messages: 8
Registered: July 2009
Junior Member
Doug,

I have attached IngresPlatform.java and is Attachment 116989...

Regards,
Usha
Re: EclipseLink Test suite and Ingres [message #382803 is a reply to message #382801] Wed, 05 November 2008 05:29 Go to previous messageGo to next message
Doug Clarke is currently offline Doug ClarkeFriend
Messages: 155
Registered: July 2009
Senior Member
Usha,

None of the Oracle committers to EclipseLink are on the west coast or have
travel plans to be out there next week. I will bring this to the attention
of our Sun committer to see if he is interested in presenting.

Doug
Re: EclipseLink Test suite and Ingres [message #383008 is a reply to message #382803] Wed, 05 November 2008 18:16 Go to previous message
Usha Rajsekar is currently offline Usha RajsekarFriend
Messages: 8
Registered: July 2009
Junior Member
Thanks Doug. I appreciate it.

Regards,
Usha
Previous Topic:Using EclipseLing with Spring WebFlow
Next Topic:EJBQL translaltion problem
Goto Forum:
  


Current Time: Thu Apr 18 01:04:59 GMT 2024

Powered by FUDForum. Page generated in 0.02803 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top