ORA-40842 unsupported value EMBEDDED_OID in the metadata

I was assisting a customer with an issue related to the SODA/MongoDB API. They were encountering the ORA-40842 error in Autonomous Database – Shared (19c). After several troubleshooting sessions, we determined that updating the application driver to the latest version resolves the problem. For Java, specifically, you need orajsoda-1.1.27(or newer) to accommodate some internal changes that support 23c JSON objects.

You can find the update here. From release notes:

SODA 1.1.27

    Support for 23ai JSON collection table (new default collection on 23ai with compatible 23 or higher)
    Support for Duality Views
    Indexing and orderbys on JSON type
    New item methods
    Changed required dependencies from javax.json to jakarta.json (new JSONP API and its Parsson implementation)
    Bug fixes

Using the old version

Using orajsoda > 1.1.27

pom.xml to work with orajsoda 1.127, you must use the jakarta.json

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>soda-parent</artifactId>
    <groupId>com.oracle.database.soda</groupId>
    <version>${revision}</version>
    <packaging>pom</packaging>
    <name>parent</name>

    <modules>
        <module>orajsoda</module>
    </modules>

    <properties>
        <outputDirectory>../lib</outputDirectory>
        <excludes>**/*.ade_path/**</excludes>
        <label>github</label>
        <revision>1.1.27</revision>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <excludes>
                        <exclude>${excludes}</exclude>
                    </excludes>
                    <testExcludes>
                        <exclude>${excludes}</exclude>
                    </testExcludes>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>lib</directory>
                            <includes>
                                <include>*.jar</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <inherited>false</inherited>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>jakarta.json</groupId>
                                    <artifactId>jakarta.json-api</artifactId>
                                    <version>2.1.3</version>
                                    <outputDirectory>lib</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.eclipse.parsson</groupId>
                                    <artifactId>jakarta.json</artifactId>
                                    <version>1.1.5</version>
                                    <outputDirectory>lib</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>javax.json</groupId>
                                    <artifactId>javax.json-api</artifactId>
                                    <version>1.1.4</version>
                                    <outputDirectory>lib</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.oracle.database.jdbc</groupId>
                                    <artifactId>ojdbc8</artifactId>
                                    <version>23.3.0.23.09</version>
                                    <outputDirectory>lib</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>junit</groupId>
                                    <artifactId>junit</artifactId>
                                    <version>3.8.1</version>
                                    <outputDirectory>lib</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>


    <dependencies>

        <dependency>
            <groupId>org.eclipse.parsson</groupId>
            <artifactId>parsson</artifactId>
            <version>1.1.7</version>
        </dependency>


        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-api</artifactId>
            <version>2.1.3</version>
        </dependency>


        <dependency>
            <groupId>jakarta.json</groupId>
            <artifactId>jakarta.json-tck</artifactId>
            <version>2.1.1</version>
            <type>pom</type>
        </dependency>

    

        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc11-production</artifactId>
            <version>23.5.0.24.07</version>
            <type>pom</type>
        </dependency>

    </dependencies>
</project>

All the MongoDB API commands are working with this collection:

Keeping your application updated to the latest version is crucial for several reasons,updates often introduce new features and enhancements that can provide a better user experience and increase your productivity. By ensuring your application is always up-to-date, you can avoid compatibility issues with other software and benefit from the latest innovations and improvements.

In short, regularly updating your application ensures it remains secure, efficient, and equipped with the latest features to meet your needs.

chevron_left
chevron_right