kubo / rust-oracle

Oracle driver for Rust
191 stars 44 forks source link

timesten #11

Closed jamessewell closed 5 years ago

jamessewell commented 5 years ago

Should this work with timesten? I'm not having much luck - although I get the feeling it should

kubo commented 5 years ago

I don't know whether it works with TimesTen.

Rusy-oracle uses OCPI-C, which uses OCI. There for rust-oracle is an OCI program. On the other hand, this document says that "OCI programs that use the Oracle Client 11.2.0.2 library do not have to be recompiled or relinked to be executed with TimesTen." So it may work with TimesTen if ODPI-C doesn't use unsupported OCI calls.

cjbj commented 5 years ago

There's a 'good chance' it will work but maybe something rust-oracle relies on isn't supported by TimesTen; and some Oracle DB features obviously aren't supported. The cx_Oracle driver (which also sits on ODPI-C) is the focus of the TimesTen team: https://twitter.com/ScalableDBDoug/status/1075238723334230017 You should contact the TimesTen people and let them know what you are seeing. Posting details here may help, too.

jamessewell commented 5 years ago

I did actually (kindof) get this working in the end!

You need to use a connection string like this: localhost/dsn:timesten_client (which will lookup the DSN in your sys.odbc.ini or odbc.ini file).

Unfortunately I couldn't go any further as I got:

Error: OciError(DbError { code: 57000, offset: 0, message: "ORA-57000: Invalid value (1) for TypeMode connection attribute -- value must be (0) for OCI connections but data store was created with (1)", fn_name: "dpiConn_create", action: "begin session" })

This is expected though, as OCI doesn't support TimesTen with a TimesTen (not Oracle) TypeMode.

anthony-tuininga commented 5 years ago

@jamessewell, not sure, but it looks like TimesTen does not support OCI_THREADED mode and it looks like rust-oracle sets that explicitly. You can try deliberately disabling that automatic setting to see if the problem you mentioned disappears.

anthony-tuininga commented 5 years ago

Reading your comment again, though, it may not be relevant. If so, just ignore this!

jamessewell commented 5 years ago

Just for others who come past - the OCI_THREADED hint may work - but if your TT datastore is in TypeMode 1 you ain't getting any further with any OCI connections from anything.