ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Perez" <quimic...@gmail.com>
Subject Sybase OEM
Date Sat, 12 Apr 2008 11:20:56 GMT
Hi All,

I'm trying to adapt an existing application running with ibatis, to work
with sybase.

To write the sqlpmaps, I've just rewrited the SQL server 2000 ones, and just
worked ok. The tests were done with Sybase ASA 9.x (the "enterprie
version").

The problem begins when trying to get it working with Sybase OEM, that it's
the same databae enginte, but ready to embed into applications. My company
has a OEM contract to use this engine as an embedded database in our
products. But (and here starts the nightmare), due to some license
restrictions it's mandatory send a sentence each time you start a connection
database like:

SET TEMPORARY OPTION connection_authentication="XXXXXXXXXXXXX" [really a
very large string]

Otherwise you'll only be able to send select statements to the database, and
get disconnected after 10 seconds aprox.

The first attempt was, in my sybase-database.properties, put a jdbc url:

jdbc:sybase:localhost:port?ServiceName=database_name?sqlinitstring="set
temporary ........"

But I get an exception due to the driver. It seems like the jdbc url cannot
be longer than 253 chars, and the auth_string is about 500 chars long.

Also I 've tried to send this "set option" trought an ibatis "update"
statements, like an stored procedure, but unsuccessfully.

The last test to get it working, was:
In this code:
http://www.mirthproject.org/fisheye/browse/Mirth/tags/1.7.0/server/src/com/webreach/mirth/server/util/SqlConfig.java?r=2754

after the .buildSqlMapClient() call, doing a (in pseudo-code)

conn = sqlMap.getDatasource().getConnection();
Statement stmt = conn.createStatement();
stmt.execute("set temporary ....");
stmt.commit();

To try to bypass Ibatis layer [yes, it's horrible]

Could anyone help me to figure out how can I send the "set temporary option
..." for every connection created to the database ?

thanks in advance.


-- 
3rd Law of Computing:
Anything that can go wrSegmentation fault -- core dumped.

Mime
View raw message