This content has been marked as final. Show 7 replies
In addition, when I remove entry from tnsname.ora it throws ORA-12154: TNS:could not resolve the connect identifier specified exception. So that indicates that it finds tns entry, but like there is something wrong with SystemDSN, service or smth else. But, on the other hand, that DSN works fine with SQL Developer.
Also, with ttIsql utility I'm able to connect to DSN:
Command> Connect TT_ItemCache;
Connection successful: DSN=TT_ItemCache;UID=nikola.bajic;DataStore=C:\TT_Temp\TT
(Default setting AutoCommit=1)
Edited by: Johnny88 on Jan 16, 2013 4:37 AM
Could you please post the code you use and the exact error which you get. Additionally, please check the env variables, like CLASSPATH, LD_LIBRARY_PATH and etc. like here(java.sql.SQLException: Problems with loading native library/missing methods
Also "Verify that either the entry in the tnsnames.ora file is associated with a TimesTen DSN or service_name in the Easy Connect string is set to a TimesTen DSN." (http://download.oracle.com/otn_hosted_doc/timesten/odpnet/readme.htm)
//connStr = "Data Source = localhost/TT_ItemCache:timesten_direct "; //+";user id=" + user + ";password=" + pwd; + ";Statement Cache Size=0"; ///ezconnect
connStr = "Data Source = TNS_ITEM_CACHE"; ///tns name
private OracleConnection GetConnection(String connStr)
OracleConnection con = new OracleConnection(connStr);
*Exception is thrown at con.Open();
I executed ttEnv.bat and maualy added LD_LIBRARY_PATH, but that should not be a problem because TimesTen is working fine in other tools (SQL Developer, ttIsql utility,...).
What does it mean "associated with a TimesTen DSN"? I enetered name of my SystemDSN (used by other tools) in tnsname entry as SERVICE_NAME attrubute. I also tried with ezconnect but same thing happens.
Exact exception is:
Oracle.DataAccess.Client.OracleException was unhandled
Message=ORA-29158: Unable to open library.
Source=Oracle Data Provider for .NET
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at TTItemCache.ItemCache.GetConnection(String connStr) in C:\Users\nikola.bajic\Documents\Visual Studio 2010\Projects\Project1\Project1\TTItemCache.cs:line 48
at TTItemCache.ItemCache..ctor() in C:\Users\nikola.bajic\Documents\Visual Studio 2010\Projects\Project1\Project1\TTItemCache.cs:line 39
at TTItemCache.ItemCache.Main(String args) in C:\Users\nikola.bajic\Documents\Visual Studio 2010\Projects\Project1\Project1\TTItemCache.cs:line 55
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String args)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
What exact version of TimesTen are you using (full output of ttVersion command)? And version of ODP.NET? Are you sure all components are either 32 or 64 bit (i.e. you are not mixing 32 and 64 bit components)?1 person found this helpful
And can you please post the exact TNS entry and snapshots of the ODBC DSN setup. The 'cannot open library' error is quite generic and typically relates to some TNS name resolution or configuration issue.1 person found this helpful
I think I've come up with solution. Apparently I was using 32bit ODAC for 64bit TimesTen... I installed 64bit version, copied .ors files, imported correct DataAccess.dll and exception dissapeared. There is other one now, but I'm working on it. Anyway, thank you for your time, both Chris and Gena.
Edited by: Johnny88 on Jan 17, 2013 3:38 AM