Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » EL issues SELECT 1 after every exception [SYBASE](EL issues SELECT 1 after every exception [SYBASE])
EL issues SELECT 1 after every exception [SYBASE] [message #1384784] Sun, 01 June 2014 10:01 Go to next message
Eclipse UserFriend
Why does EL issues SELECT 1 after every exception ? Is there a way to avoid the issuing of this SELECT 1 as it is hanging/lockig the table and the connection is not being released? Thanks!
Re: EL issues SELECT 1 after every exception [SYBASE] [message #1384854 is a reply to message #1384784] Mon, 02 June 2014 10:17 Go to previous messageGo to next message
Eclipse UserFriend
The "SELECT 1" is issued after exceptions to determine if the exception is a communication exception that would necessitate throwing away the connection. If the test passes, the connection can be reused and placed back in the pool or the query retried. This should not cause a problem, as the select is not issued against a table, so nothing should be locked, and the connection itself should be returned to the connection pool (or released if there was a problem with it). So if you are having issues with connections, you should post the settings you are using to configure your pool, and detail what your issues are. To prevent the select, set the pingSQL in the DatabasePlatform to null using a customizer with the setPingSQL(null) method.

Best Regards,
Chris

[Updated on: Mon, 02 June 2014 10:18] by Moderator

Re: EL issues SELECT 1 after every exception [SYBASE] [message #1385026 is a reply to message #1384854] Tue, 03 June 2014 13:57 Go to previous messageGo to next message
Eclipse UserFriend
Looks like the problem comes down to the commit piece, when I try to insert a record into the table that already exists, it fails with the unique constraint issue. Along with that what happens is my sql is not rollback and so the chained mode is not set back to off.
I get to see the below in the db logs,

set CHAINED on
DELETE FROM xx WHERE (xx = @p0)
commit
commit
set CHAINED off
SELECT xx FROM xx
set CHAINED on
INSERT INTO xx (xx) VALUES (@p0x)
SELECT 1
If you notice the above, its clear that the set chained mode is not set back to off again and this is holding the connection to be locked (along with the SELECT 1).

And the app logs are as below, even though am explicitly issuing a rollback, it doesn't effct cause while the commit fails it seems the transaction is inactivated.

Is Tran ACtive? true // Before issuing commit()
Exception while Committing - Is Tran ACtive? false // Tran status after commit() failed
Exception while Committing, check-- >javax.persistence.RollbackException: // error thrown while committing
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.sybase.jdbc3.jdbc.SybBatchUpdateException: JZ0BE:
BatchUpdateException: Error occurred while executing batch statement:
Attempt to insert duplicate key row in object 'x' with unique index 'pk_x'
Re: EL issues SELECT 1 after every exception [SYBASE] [message #1385123 is a reply to message #1385026] Wed, 04 June 2014 09:11 Go to previous message
Eclipse UserFriend
In http://stackoverflow.com/questions/23990355/jpa-eclipselink-issues-select-1 you mention this works on WebLogic. What are the differences between your settings?

As EclipseLink has nothing to do with setting the CHAINED on or off, I'm unsure what this means. You are using a resource_local em, so the transaction should be rolled back on the error. Check your settings to make sure the connections are configured properly and the driver version behaves correctly.
Previous Topic:@OneToMany relations with @NOSQL don't works
Next Topic:Eclipse link Create
Goto Forum:
  


Current Time: Sat Jul 05 11:52:01 EDT 2025

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

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

Back to the top