Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORDS with TNS - error when trying to connect DB for APEX

alacourbOct 28 2021

Oracle 12.1.0.2 with APEX 21.1
ORDS 21.3 on Tomcat 9.0.54 - Windows Server 2019
I'm getting following error when starting Tomcat which prevents ORDS from connecting to the DB:
oracle.net.resolver.EZConnectResolver.parseExtendedProperties Extended settings parsing failed. java.lang.RuntimeException: Invalid character at 24 : \
oracle.dbtools.common.logging.JDKLogSink.record IO Error: Invalid connection string format, a valid format is: "host:port:sid" (CONNECTION_ID=X8ADepYuRpK1p8FSAKp41Q==),|apex||-2021-10-26T20-46-37.212127400Z,jdbc:oracle:thin:@myDB?TNS_ADMIN=D:\App\Oracle\tns
oracle.dbtools.common.logging.JDKLogSink.record The pool named: |apex|| is invalid and will be ignored: ORDS was unable to make a connection to the database. This can occur if the database is unavailable, the maximum number of sessions has been reached or the pool is not correctly configured. The connection pool named: |apex|| had the following error(s): IO Error: Invalid connection string format, a valid format is: "host:port:sid" (CONNECTION_ID=X8ADepYuRpK1p8FSAKp41Q==)
When I'm using Basic connection instead of TNS it works perfectly. The TNS file format is fine since it works with ORDS 21.1.
I have also tried ORDS 21.2: same issue as with 21.3.
ORDS seems to have an issue with tns connection starting from version 21.2.
Any idea?

This post has been answered by Gerardo Gomez-Oracle on Jan 12 2022
Jump to Answer

Comments

Sanjeev-OFM

Hello Friends,

Any Suggestion??

Thanks
Sanjeev

Timo Hahn

User, tell us your exact JDev version, please!
I don't see any chance to do this declaratively.
You can do this as a groovy script or a java business rule in the VO/EO.

Timo

Sanjeev-OFM

Hi Timo,
Thanks for the update jdev version is 11.1.1.9.0.

Thanks
Sanjeev

Sanjeev-OFM

Hi Timo,
Using groovy script can we validate it with the querytext result, if so please help with some information?
Thanks
Sanjeev

Timo Hahn

On second thought, I would do it in java as a business rule. This way you are free to use pl/sql or other methods to help you implement the validation.
Using groovy limits you somewhat, e.g., you can't easily call other methods from different objects like AM or other VOs.

Timo

Sanjeev-OFM

Hi Timo,
Thanks for the information, want to check one more thing, where we can have this validation in EOImpl.java file or in backing bean, Which one will be the best suggestable approach?
Kindly suggest.
Thanks
Sanjeev

Timo Hahn

The rule of thumb is to install validations at the EO level. This ensures that every data written to the DB has been validated. ADF uses this approach but adds some client-side validation too (e.g. checking for numbers). Still, all data written to DB tables should be valid.
As a DBA I would enforce the final validation in the DB using constraints. In the end, users expect to see valid data in the DB and a DBA will not trust anybody but the DB.
I would implement the validation in the DB (that's the DBAs work) and on EO level.
Timo

Sanjeev-OFM

Hi Timo,
Thanks for the information, want to check can we do the transit attribute level validation in Enitiy Object at attribute level or at entity level.
Please suggest.

Thanks
Sanjeev

Timo Hahn

You can do both. It depends on the use case. If the attribute can be tested without knowing other values from the same EO (or other EOs), you can do it at the attribute level. If the attribute needs information from other attributes of the same EO, it's better to do an entity-level validation. This way, you know that all attributes are given (have the values the user wants to store), and the validation must fulfill the rule.

Timo

Sanjeev-OFM

Hi Timo,
Thanks for the information, I'm having one transit attribute(EMPName) which is based on other db attribute(Ename) of Entity Object.
Here when I'm doing the entity level validation on db attribute(Ename) it's performing the validation and showing the error message properly but when I'm doing the same validation on transit attribute (which is based on db attribute using groovy). I've assign the Ename db attribute value to EMPName transit attribute) the validation is not getting triggered and not showing any validation message.
Jdeveloper version is 11.1.1.9.0.
Kindly suggest.

Thanks
Sanjeev
SA.7z (167.81 KB)

Timo Hahn

Sanjeev, I'm not sure what to do with the test case. I don't see any description on how to get to the problem. Please tell me what to do.
From what I see in the sources, you don't get any exception because there is no rule defined for your transient attribute.

Timo

Sanjeev-OFM

Hi Timo,
Actually having two attribute EName which is db attribute on this if I'm putting validation either on attribute or entity level it's showing the message properly.
DBAttributeListValidationError.JPGDBEntityIstValidation.JPGbut if the same validation i'm applying on transit attribute EMPName (which is based on EName ) is not triggering any validation neither at entity level nor at attribute level and not showing any message.

TransistEntityLevelValidation.JPGTransitAttributeLevelValidation.JPG
Kindly suggest, how i can trigger the validation on transit attribute.
Thanks
Sanjeev

Timo Hahn

Sanjeev, your data model is OK, but the rules you try to implement are not. You can't implement a rule that the data in the DB is not fulfilling. The transient attribute EMPName should be one of the department names from the dept table but must be equal to the emp_name attribute of the employee. This rule is not valid in the data you added to the DB.
So, your test case can't be used to show anything. A test case should show the problem but should not be the problem.
If you remove the emp_name setting from the transient attribute and add a rule that checks if the value entered by the user is a known department name (from the list rule), it works as expected.
Timo

Sanjeev-OFM

Hi Timo,
Thanks for the information and yes you are right in this way we can do the transit attribute validation.
Actually as we need to validate one of the DB attribute which hold 8 combined value ie.("001.100.101.00012.ABC123,24343,12019,ak200") and we need to validate starting 4 value ie.("001.100.101.00012") with other query result so to achieve this declaratively I thought to have 1 transit attribute and compare the value with query result but somehow it's not working so thought to check.
Please suggest if there is any other way to achieve this using declarative approach.
Thanks
Sanjeev

Timo Hahn

Well, I remember that I told you to do this in the DB already.
Sure, you can use a transient or original attribute and compare it against something else. But why do you want to do it declarative?
You need to extract part of the original value and compare it. This you don't do declaratively. Use either a groovy expression or use a method validator.

Timo

1 - 15

Post Details

Added on Oct 28 2021
43 comments
4,407 views