Giter Club home page Giter Club logo

Comments (6)

Mani9395 avatar Mani9395 commented on July 28, 2024 1

ORA-01441: cannot decrease column length because some value is too big

Above error will produce when you are trying to modify the column to one value, and that column contains data, whose length is more than setting value, then it will throw error.

So, the only solution is to find the row-column values whose length is more that setting value and modify the data to a small value.

from jooby.

jknack avatar jknack commented on July 28, 2024

Is a the driver the issue? The HikariModule set up pool class name to oracle.jdbc.pool.OracleDataSource

Don't seem to be a Jooby issue.

from jooby.

k1ll1n avatar k1ll1n commented on July 28, 2024

I tried to make a manual connection, and it has no problems.

public class HibernateUtil {

    private static SessionFactory sessionFactory;

    public static SessionFactory getSessionFactory() {
        if (sessionFactory == null) {
            StandardServiceRegistry standardRegistry = new StandardServiceRegistryBuilder()
                    .applySettings(getConfigurationProperties())
                    .build();
            try {
                Metadata metadata = new MetadataSources(standardRegistry)
                        .addAnnotatedClass(Test.class)
                        .buildMetadata();

                sessionFactory = metadata.getSessionFactoryBuilder().build();
            } catch (Exception e) {
                System.err.println("Error create SessionFactory: " + e);
                if (standardRegistry != null) {
                    StandardServiceRegistryBuilder.destroy(standardRegistry);
                }
            }
        }
        return sessionFactory;
    }

    private static Properties getConfigurationProperties() {
        Properties properties = new Properties();
        properties.put(Environment.DRIVER, "oracle.jdbc.driver.OracleDriver");
        properties.put(Environment.URL, "jdbc:oracle:thin:@domain.com:1521:PHX");
        properties.put(Environment.USER, "USER");
        properties.put(Environment.PASS, "PASSWORD");
        properties.put(Environment.DIALECT, "org.hibernate.dialect.OracleDialect");
        properties.put(Environment.SHOW_SQL, "true");
        properties.put(Environment.FORMAT_SQL, "true");
        properties.put(Environment.HBM2DDL_AUTO, "validate");

        return properties;
    }

    public static void shutdown() {
        if (sessionFactory != null) {
            sessionFactory.close();
        }
    }
}

But when I use "HibernateModule" and "HikariModule" for connection, I get the problem described above. And it appears at the server startup, I do not even open any page.

Unfortunately, I can’t find a solution to the problem on my own, so I came to ask you for help.

and my gradle

buildscript {
  ext {
    joobyVersion = System.getProperty("joobyVersion")
  }
}

plugins {
  id "application"
  id "io.jooby.run" version "${joobyVersion}"
  id "io.spring.dependency-management" version "1.1.0"
  id "com.google.osdetector" version "1.7.3"
  id "com.github.johnrengelman.shadow" version "8.1.1"
}

group "com.test"
version "1.0.0"
mainClassName = "com.test.App"
sourceCompatibility = 21

repositories {
  mavenLocal()
  mavenCentral()
}

dependencyManagement {
  imports {
    mavenBom "io.jooby:jooby-bom:$joobyVersion"
  }
}

dependencies {
  implementation "io.jooby:jooby-netty"
  implementation "io.jooby:jooby-logback"
  implementation "io.jooby:jooby-guice"
  annotationProcessor "io.jooby:jooby-apt"
  implementation 'org.reflections:reflections:0.10.2'

  implementation 'io.jooby:jooby-hikari:3.1.2'
  implementation 'io.jooby:jooby-hibernate:3.1.2'
  implementation 'com.oracle.database.jdbc:ojdbc10:19.23.0.0'

  testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.2"
  testImplementation "org.junit.jupiter:junit-jupiter-engine:5.10.2"
  testImplementation "io.jooby:jooby-test"
  testImplementation "com.squareup.okhttp3:okhttp:4.12.0"
}

test {
  useJUnitPlatform()
}

/** Java debug information: */
tasks.withType(JavaCompile) {
  options.compilerArgs += [
    '-parameters',
  ]
  options.debug = true
}

shadowJar {
  mergeServiceFiles()
}

joobyRun {
  mainClass = mainClassName
  restartExtensions = ["conf", "properties", "class"]
  compileExtensions = ["java"]
  port = 8080
}

from jooby.

jknack avatar jknack commented on July 28, 2024

Odd. Is there way to bootstrap an oracle db with Docker? Never used Oracle :S

from jooby.

k1ll1n avatar k1ll1n commented on July 28, 2024

Odd. Is there way to bootstrap an oracle db with Docker? Never used Oracle :S

Hello, unfortunately there is no such possibility.
And you also have no ideas on how to solve my problem?

from jooby.

jknack avatar jknack commented on July 28, 2024

ORA-01441: cannot decrease column length because some value is too big

Seems to be a schema/datatype issue, but I can't reproduce it to be 100% sure

from jooby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.