How do I make triggers fire without error when connecting to an OpenEdge 12.2 database using JDBC? - jdbc

I am connecting to an OpenEdge 12.2.0 database using the latest OpenEdge JDBC driver. The OpenEdge database is using Eclipse Temurin JDK version 11.0.14.101 and the application that connects via JDBC is using Eclipse Temurin JDK version 8.0.322.6. Both the database and the application are running on the same Windows 10 PC.
I can create triggers without issue, but when I cause a trigger to fire by updating a row via JDBC, the following exception is thrown:
java.sql.SQLException: [DataDirect][OpenEdge JDBC Driver][OpenEdge] Failed during dynamic load of Java dynamic library. Reason = [126]The specified module could not be found.
[jvm].
I did some research and found the following articles that address this issue:
https://community.progress.com/s/article/P66180
https://community.progress.com/s/article/21181
I called the sql_env script before starting the OpenEdge database and set my CLASSPATH and PATH environment variables as advised in the above articles, but my application continues to throw this exception when it causes a trigger to fire. I first tried setting my environment variables using %DLC% and then tried using the absolute path. I suspect that the above articles are outdated, as they do not include 12.x in the affected versions and the second article only has instructions for Windows NT / 2000.
Does anyone know what I need to do to prevent this exception?

I don't know what the root cause of the issue was, but it stopped throwing the exception after I reinstalled OpenEdge.

Related

Sql Script file (apex_epg_config.sql) is missing in Oracle Apex 20.2

I have Oracle Apex 20.1 Installed on Oracle Linux 6.10 Server with Oracle Database 12.2. Recently I am trying to update into Apex 20.2 but this script file (apex_epg_config.sql) is missing in zip folder.
When I load the site then giving me this error:
There is a problem with your environment because the Application Express files are not up-to-date! The
files for version 20.1.0.00.13 have been loaded, but 20.2.0.00.20 is expected. Please verify that you
have copied the images directory to your application server as instructed in the Installation Guide.
How to solve this error?
The embedded PL/SQL Gateway (EPG) along with mod_plsql are no longer supported for Oracle APEX. This deprecation was announced in APEX 20.1.
Oracle REST Data Services (ORDS) is the only supported and documented Web listener for APEX. The configuration instructions are here. ORDS includes an embedded Web server, so in addition to being supported with Apache Tomcat and WebLogic Server, you can also run ORDS standalone.
I had the same problem after upgrading from APEX 18.2 to 20.2. I solved the problem by not executing this script. It seems that it isn't needed any longer. Update succeeded without running this script.
Attention: There is a pitfall: After upgrading you must clear your browser cache (only images). When I cleared the browser cache, the error message disappeared.

Spring Boot - Unable to connect Azure MySQL database

I am new in connecting azure MySQL database from Spring boot application.
Below is the snippet mentioned in application.properties
spring.datasource.url=jdbc:mysql://XXXX.mysql.database.azure.com:3306/MyDbName
spring.datasource.username= ******
spring.datasource.password= ******
I have faced the following exception
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable 'query_cache_size'
I have googled and somewhere it was mentioned that it is required to update the version of MySQLConnector to 8.0.13
Please help me find the solution.
Based on your exception , its not because of Azure mysql. Its because of system variable 'query_cache_size'. refer : java.sql.SQLException: Unknown system variable 'query_cache_size'
I too have met this bundle of joy on azure MySQL. As dvo mentions it places this variable in when it thinks it is under version 8.0.3.
From com.mysql.cj.NativeSession.java...
if (!versionMeetsMinimum(8, 0, 3)) {
queryBuf.append(", ##query_cache_size AS query_cache_size");
queryBuf.append(", ##query_cache_type AS query_cache_type");
}
But as my Azure MySQL version is 8.0.15 which matches my driver version then I suspect whilst the database may well be version 8 part of the stack the driver deals with is not.
Edit:
From https://learn.microsoft.com/en-us/azure/mysql/concepts-limits
Current known issues
MySQL server instance displays the wrong server version after connection is established. To get the correct server instance engine version, use the select version(); command.
So I'm guessing that this is the problem and as it stands Azure MySQL 8 will not work with the java mysql connector.
I'll probably look at building the connector myself and hard coding in the version number to 8.0.15. What joy.
Edit Edit:
Modified ServerVersion.java parseVersion(…) to return
return new ServerVersion(8, 0, 15);
Which works around the problem enough for me to carry on with my work.
It's a problem Microsoft should be fixing ASAP on their side.

ORA-28040: No matching authentication protocol exception

I am trying to connect my grails project to Oracle databse(Oracle 12c) in windows(8) system. However, whenever I run my application I get following exception :
Caused by: org.apache.commons.dbcp.SQLNestedException:
Cannot create PoolableConnectionFactory (ORA-28040:
No matching authentication protocol)
Caused by:
java.sql.SQLException: ORA-28040:
No matching authentication protocol
According to internet suggestion I also tried editing my *.ora file but it is not working.
I added following snippet in sqlnet.ora file :
SQLNET.ALLOWED_LOGON_VERSION=10
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
Here i tried assigning (10,11,12) but neither of them is working.
Can anyone please help me with this ?
I deleted the ojdbc14.jar file and used ojdbc6.jar instead and it worked for me
Here is some text I found at experts-exchange:
Bug 14575666
In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION
parameter has been updated to 11. This means that database clients
using pre-11g JDBC thin drivers cannot authenticate to 12.1 database
servers unless theSQLNET.ALLOWED_LOGON_VERSION parameter is set to the
old default of 8.
This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to
fail with the ORA-28040: No matching authentication protocol error in
12.1 Oracle ASM and Oracle Grid Infrastructure environments.
Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the
oracle/network/admin/sqlnet.ora file.
This except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
If you get "ORA-01017: invalid username/password; logon denied" error, then you need to re-create your password.
I resolved this issue by using ojdbc8.jar.
Oracle 12c is compatible with ojdbc8.jar
I was using eclipse and after trying all the other answers it didn't work for me.
In the end, what worked for me was moving the ojdb7.jar to top in the Build Path. This occurs when multiple jars have conflicting same classes.
Select project in Project Explorer
Right click on Project -> Build Path -> Configure Build Path
Go to Order and Export tab and select ojdbc.jar
Click button TOP to move it to top
Very old question but providing some additional information which may help someone else. I also encountered same error and I was using ojdbc14.jar with 12.1.0.2 Oracle Database. On Oracle official web page this information is listed that which version supports which database drivers. Here is the link and it appears that with Oracle 12c and Java 7 or 8 the correct version is ojdbc7.jar.
In the ojdbc6.jar is for 11.2.0.4.
Except for adding the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
I also added the following to both the Client and Server, which resolved my issue
SQLNET.AUTHENTICATION_SERVICES = (NONE)
Also see post
ORA-28040: No matching authentication protocol
Adding
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
is the perfect solution
sql.ora directory
..\product\12.1.0\dbhome_1\NETWORK\ADMIN
My Initial error is : ORA-28040: No matching authentication protocol exception
My DB version is 12.2 (Solaris) and client version is 11.2 ( windows). I have added below in both server and client sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
while connecting, I have got invalid username and password hence I have recreated the password ( same password ) in database which is resolved my issue.
While for most cases replacing ojdbc driver jar will be the solution, my case was different.
If you are certain you are using correct ojdbc driver. Double check if you are actually connecting to the database you are thinking you are. In my case jdbc configuration (in Tomcat/conf) was pointing to different database that had different Oracle version.
just install ojdbc-full, That contains the 12.1.0.1 release.

OCISessionBegin hangs in multithreaded COM+ applications [Delphi + ODAC + Oracle]

We have here a application that uses ODAC components inside COM+ dlls to connect to Oracle Server 11g.
Lately we are facing a problem that we cannot find the solution.
For some reason, when the concurrency of the application server at some of our clients is too high, some dlls starts to hang and they have to kill the process to restore the usability of our product. Trying to reproduce the error here at our office, we created a test environment to stress an application server. We start 30-50 programs that make calls to application and after some time the problem appears.
Debugging our DLL after the server hangs, shows that any subsequent call to OCISessionBegin cannot complete. No error is generated. No other symptoms are visible.
The last line that the we try to execute is: Check(OCISessionBegin(...)); on OraClasses.pas
We checked the database no contention, no lock.
We are using ODAC 6 on our clients, but we upgraded it to the last version and the problem persists. We have to use the Oracle Client 10 to connect to the database 11g because the are using the version 6 of ODAC.
Thanks a lot
AFAIK you need to create your environment with both OCI_EVENTS + OCI_THREADED attributes sets, in such a configuration.
For instance, here is how it is initialized in our Open Source direct Oracle access unit:
fEnvironmentInitializationMode := OCI_EVENTS or OCI_THREADED;
...
with OCI do
try
if fEnv=nil then
// will use UTF-8 encoding by default, in a multi-threaded context
// OCI_EVENTS is needed to support Oracle RAC Connection Load Balancing
EnvNlsCreate(fEnv,Props.EnvironmentInitializationMode,
nil,nil,nil,nil,0,nil,OCI_UTF8,OCI_UTF8);
I suspect you have to check how your OCI environment is created in ODAC.

What causes a JDBC Type 91 error?

I have a web app hosted on BEA Weblogic 10.x with an Oracle 10g database backend.
It works perfectly with one database, but when we make a clone of it and try to use a different WebLogic and Oracle instance we are getting this error:
ERROR - Problem initializing invocation tracking - disabling
tracking xxxxclass.BadTableMappingException: Database column
xxxxPeriodEnding in database yyyyyyy, table zzzzzzz has an
unknown type: JDBC Type 91.
We get it every time we do a query that involves a column of type DATE. There was no ORA-XXXX code in the message.
I can access the database using SQL*Plus using the same access and do selects and updates on the same tables with no errors.
The answer to this question is not just a simple description of what a type 91 error is (although that will help) but what could be causing this given the circumstances described above.
I am using ojdbc14.jar for JDBC on both instances of weblogic.
I have no idea about the error, but have you considered the jdbc jar version and more importantly if the oracle DB needs to be updated.
I faced very weird problems with oracle, and struggled for a while to find at the end that installing some patches for oracle would solve the problem.
Set oracle.jdbc.V8Compatible=true.
This remaps the oracle DATE type to a DATETIME time in JDBC. This parameter was missing on the new Weblogic server.

Resources