Bugs item #940654, was opened at 2004-04-23 11:33
Message generated for change (Comment added) made by ejort
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=940654&group_id=22866

>Category: JBossCX
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Antti Lehto (anajavi)
>Assigned to: Adrian Brock (ejort)
Summary: Cannot use check-valid-connection-sql on sybase w/o tx

Initial Comment:
When using check-valid-connection in *-ds.xml, cannot
use EJB's without transaction.

When doing conn.createStatement() inside
non-transactional (transaction=never) sessionbean, pool
tries to set autocommit to true. This makes sybase
throw exception, because it cannot alter state of
autocommit in the middle of a transaction. The
transaction begins when check-valid-connection-sql is run.

Is it possible to run check-valid-connection-sql with
autocommit=true or perform rollback after sql is run?
It would prevent this error.

here's a snippet from xxx-ds.xml:
<local-tx-datasource>
    <jndi-name>xxxDS</jndi-name>
   
<connection-url>jdbc:sybase:Tds:localhost:4100/xxx</connection-url>
   
<driver-class>com.sybase.jdbc2.jdbc.SybDriver</driver-class>
    <user-name>xxx</user-name>
    <password>xxx</password>
    <check-valid-connection-sql>select
1</check-valid-connection-sql>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
  </local-tx-datasource>

Haven't yet tried this with other databases.

----------------------------------------------------------------------

>Comment By: Adrian Brock (ejort)
Date: 2004-04-23 14:32

Message:
Logged In: YES 
user_id=9459

This sounds like a bug with the Sybase driver

According to the javadocs for setAutoCommit()
"NOTE: If this method is called during a transaction, the
transaction is committed." 
i.e. when it does setAutoCommit(true) it should commit
the transaction.

I've heard of a couple of funnies with Sybase which
<no-tx-separate-pools/> fixes (although this was meant as
workaround
for OracleXA - OracleXA would definitely dislike
setAutoCommit(true) running that query)

You can fix it yourself, simply add
   
<valid-connection-checker-class-name>YourConnectionCheckerClass</valid-connection-checker-class-name>
based on the default implementation:
http://cvs.sourceforge.net/viewcvs.py/jboss/jbosscx/src/main/org/jboss/resource/adapter/jdbc/CheckValidConnectionSQL.java?rev=1.2&view=auto

You might need to be careful, becuase the value of
autocommit could
be true or false when this routine runs.

If you get it to work, please submit the workaround back.

----------------------------------------------------------------------

Comment By: Antti Lehto (anajavi)
Date: 2004-04-23 11:36

Message:
Logged In: YES 
user_id=968546

Forgot versions:
JBoss 3.2.3
Sybase ASE 12.5
JConnect 5.5

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=940654&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to