I have Spring boot 2 applications, when I am firing a select query, before actual query runs one validation query "SELECT 1" is being called because of DB pool wants to validate if the pooled connection is alive or not,
"Select 1" is also taking long time, what can be done to improve performance, of course disabling "Select 1" validation is not a good idea
2019-10-01 20:54:43.352 DEBUG 15196 --- [nio-8081-exec-1] org.hibernate.SQL :
/* SELECT
MY Hibernate Query
2019-10-01 20:54:43.354 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:7 created by (ConnectionID:1 ClientConnectionId: 5494adca-2bef-4403-bcb6-713b676df4fd)
2019-10-01 20:54:43.354 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:7 Executing (not server cursor) SELECT 1
2019-10-01 20:54:43.612 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerResultSet : SQLServerResultSet:7 created by (SQLServerStatement:7)
2019-10-01 20:54:43.647 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerPreparedStatement:8 created by (ConnectionID:1 ClientConnectionId: 5494adca-2bef-4403-bcb6-713b676df4fd)
2019-10-01 20:54:43.740 TRACE 15196 --- [nio-8081-exec-1] o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [US]
2019-10-01 20:54:43.766 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerStatement : SQLServerPreparedStatement:8: calling sp_executesql: SQL:/* SELECT c.shippingZone.currency.isoName FROM Country c WHERE c.id = :countryCode */ select currency2_.ISO_NAME as col_0_0_ from TBL_COUNTRY country0_ left outer join TBL_SHIPPING_ZONE_COUNTRY country0_1_ on country0_.ID=country0_1_.COUNTRY_ID cross join TBL_SHIPPING_ZONES shippingzo1_ cross join TBL_CURRENCIES currency2_ where country0_1_.SHIPPING_ZONE_ID=shippingzo1_.ID and shippingzo1_.CURRENCY_ID=currency2_.ID and country0_.ID=#P0
2019-10-01 20:54:44.029 DEBUG 15196 --- [nio-8081-exec-1] c.m.s.jdbc.internals.SQLServerResultSet : SQLServerResultSet:8 created by (SQLServerPreparedStatement:8)
2019-10-01 20:54:44.043 DEBUG 15196 --- [nio-8081-exec-1] org.hibernate.loader.Loader : Result set row: 0
2019-10-01 20:54:44.044 DEBUG 15196 --- [nio-8081-exec-1] org.hibernate.loader.Loader : Result row:
Related
I have this error while I have added addtional enity called User. When I run this program without the User classes its working fine. I am trying to add a logging to the app. I thibk this is a problem with H2Dialect. Can anyone help please ?
2022-11-04 17:25:46.838 INFO 23000 --- [ main] com.ag.chateer.ChateerApplication : Starting ChateerApplication using Java 17.0.2 on STORM936 with PID 23000 (E:\new-projects-2022-2023\chateer-app-react-spring\chateer-app-spring\target\classes started by Arek in E:\new-projects-2022-2023\chateer-app-react-spring\chateer-app-spring)
2022-11-04 17:25:46.840 INFO 23000 --- [ main] com.ag.chateer.ChateerApplication : No active profile set, falling back to 1 default profile: "default"
2022-11-04 17:25:47.450 INFO 23000 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-11-04 17:25:47.512 INFO 23000 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 51 ms. Found 2 JPA repository interfaces.
2022-11-04 17:25:48.160 INFO 23000 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-11-04 17:25:48.171 INFO 23000 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-11-04 17:25:48.172 INFO 23000 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.65]
2022-11-04 17:25:48.285 INFO 23000 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-11-04 17:25:48.286 INFO 23000 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1393 ms
2022-11-04 17:25:48.323 INFO 23000 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-11-04 17:25:48.578 INFO 23000 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2022-11-04 17:25:48.589 INFO 23000 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:file:./chateer'
2022-11-04 17:25:48.822 INFO 23000 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-11-04 17:25:48.875 INFO 23000 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.10.Final
2022-11-04 17:25:49.031 INFO 23000 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-11-04 17:25:49.137 INFO 23000 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2022-11-04 17:25:49.683 WARN 23000 --- [ main] o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDL "
create table user (
id integer generated by default as identity,
email varchar(255),
password varchar(255),
username varchar(255),
primary key (id)
)" via JDBC Statement
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "
create table user (
id integer generated by default as identity,
email varchar(255),
password varchar(255),
username varchar(255),
primary key (id)
)" via JDBC Statement
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:581) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:526) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.createTable(AbstractSchemaMigrator.java:293) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:74) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:220) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:123) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:196) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:85) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:335) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1498) ~[hibernate-core-5.6.10.Final.jar:5.6.10.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.22.jar:5.3.22]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.22.jar:5.3.22]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.22.jar:5.3.22]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.22.jar:5.3.22]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.22.jar:5.3.22]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.22.jar:5.3.22]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.22.jar:5.3.22]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.22.jar:5.3.22]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) ~[spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.7.3.jar:2.7.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-2.7.3.jar:2.7.3]
at com.ag.chateer.ChateerApplication.main(ChateerApplication.java:11) ~[classes/:na]
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "\000d\000a create table [*]user (\000d\000a id integer generated by default as identity,\000d\000a email varchar(255),\000d\000a password varchar(255),\000d\000a username varchar(255),\000d\000a primary key (id)\000d\000a )"; expected "identifier"; SQL statement:
create table user (
id integer generated by default as identity,
email varchar(255),
password varchar(255),
username varchar(255),
primary key (id)
) [42001-214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214]
at org.h2.message.DbException.getSyntaxError(DbException.java:261) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readIdentifier(Parser.java:5656) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readIdentifierWithSchema(Parser.java:5616) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.readIdentifierWithSchema(Parser.java:5645) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parseCreateTable(Parser.java:9253) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parseCreate(Parser.java:6784) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parsePrepared(Parser.java:763) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parse(Parser.java:689) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.parse(Parser.java:661) ~[h2-2.1.214.jar:2.1.214]
at org.h2.command.Parser.prepareCommand(Parser.java:569) ~[h2-2.1.214.jar:2.1.214]
at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:631) ~[h2-2.1.214.jar:2.1.214]
at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:554) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1116) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:237) ~[h2-2.1.214.jar:2.1.214]
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223) ~[h2-2.1.214.jar:2.1.214]
at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java) ~[HikariCP-4.0.3.jar:na]
at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:54) ~[hibernate-core-5.6.10.Final.jar:5.6.10.F.432)
2022-11-04 17:25:50.531 INFO 23000 --- [ main] c.c.socketio.SocketIOServer : Session store / pubsub factory used: MemoryStoreFactory (local session store only)
2022-11-04 17:25:50.823 INFO 23000 --- [ntLoopGroup-2-1] c.c.socketio.SocketIOServer : SocketIO server started at port: 8085
When I run this program without User, User Service and User Repo works fine.
2022-04-03 13:51:05.343 INFO 14190 --- [rce-coordinator] .d.r.RelationalSnapshotChangeEventSource : Snapshot step 3 - Locking captured tables [dbo.Users]
2022-04-03 13:51:05.343 INFO 14190 --- [rce-coordinator] d.c.s.SqlServerSnapshotChangeEventSource : Setting locking timeout to 10 s
2022-04-03 13:51:05.344 DEBUG 14190 --- [rce-coordinator] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:3 created by (ConnectionID:2 ClientConnectionId: 4c2ec870-bbb3-4770-b4de-d72207e50092)
2022-04-03 13:51:05.344 TRACE 14190 --- [rce-coordinator] io.debezium.jdbc.JdbcConnection : executing 'SET LOCK_TIMEOUT 10000'
2022-04-03 13:51:05.344 DEBUG 14190 --- [rce-coordinator] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:3 Executing (not server cursor) SET LOCK_TIMEOUT 10000
2022-04-03 13:51:05.350 INFO 14190 --- [rce-coordinator] d.c.s.SqlServerSnapshotChangeEventSource : Executing schema locking
2022-04-03 13:51:05.350 DEBUG 14190 --- [rce-coordinator] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:4 created by (ConnectionID:2 ClientConnectionId: 4c2ec870-bbb3-4770-b4de-d72207e50092)
2022-04-03 13:51:05.352 WARN 14190 --- [rce-coordinator] .d.p.s.AbstractSnapshotChangeEventSource : Snapshot was interrupted before completion
2022-04-03 13:51:05.352 INFO 14190 --- [rce-coordinator] .d.p.s.AbstractSnapshotChangeEventSource : Snapshot - Final stage
2022-04-03 13:51:05.353 INFO 14190 --- [rce-coordinator] d.c.s.SqlServerSnapshotChangeEventSource : Removing locking timeout
2022-04-03 13:51:05.353 DEBUG 14190 --- [rce-coordinator] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:5 created by (ConnectionID:2 ClientConnectionId: 4c2ec870-bbb3-4770-b4de-d72207e50092)
2022-04-03 13:51:05.353 TRACE 14190 --- [rce-coordinator] io.debezium.jdbc.JdbcConnection : executing 'SET LOCK_TIMEOUT -1'
2022-04-03 13:51:05.353 DEBUG 14190 --- [rce-coordinator] c.m.s.jdbc.internals.SQLServerStatement : SQLServerStatement:5 Executing (not server cursor) SET LOCK_TIMEOUT -1
2022-04-03 13:51:05.356 WARN 14190 --- [rce-coordinator] i.d.p.ChangeEventSourceCoordinator : Change event source executor was interrupted
java.lang.InterruptedException: Interrupted while locking table dbo.Users
at io.debezium.connector.sqlserver.SqlServerSnapshotChangeEventSource.lockTablesForSchemaSnapshot(SqlServerSnapshotChangeEventSource.java:135) ~[debezium-connector-sqlserver-1.8.1.Final.jar!/:1.8.1.Final]
at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:106) ~[debezium-core-1.8.1.Final.jar!/:1.8.1.Final]
at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:76) ~[debezium-core-1.8.1.Final.jar!/:1.8.1.Final]
at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:153) ~[debezium-core-1.8.1.Final.jar!/:1.8.1.Final]
at io.debezium.connector.sqlserver.SqlServerChangeEventSourceCoordinator.executeChangeEventSources(SqlServerChangeEventSourceCoordinator.java:69) ~[debezium-connector-sqlserver-1.8.1.Final.jar!/:1.8.1.Final]
anyone had this issue? I got this during application startup. I assume it's a missing configuration on the database. but when i ran profiler, i dont errors. Is it suggesting debezium cannot obtain a lock?
Check if there be some code after submitting the engine to an ExecutorService. For example,
// Run the engine asynchronously ...
ExecutorService executor = Executors.newSingleThreadExecutor();
executor.execute(engine);
// Do something else or wait for a signal or an event
// YOU CAN WAITING FOREVER
while (!executor.awaitTermination(10, TimeUnit.SECONDS)) {
}
I'm currently running a DDL Script using the Liquibase Java API. The whole script and the corresponding changeSet is exceuted successfully. However, after this execution Liquibase throws a LockException.
The ERROR LOG is as follows,
21713 [main] DEBUG liquibase.ext.mssql.database.MSSQLDatabase - Executing Statement: ALTER
TABLE [dbo].[VALIDATIONEXECUTORS] CHECK CONSTRAINT [FK_MSTAPPTYPE_VLDTNEXCUTORS]
21713 [main] INFO liquibase.executor.jvm.JdbcExecutor - ALTER TABLE [dbo].[VALIDATIONEXECUTORS]
CHECK CONSTRAINT [FK_MSTAPPTYPE_VLDTNEXCUTORS]
21715 [main] DEBUG liquibase.executor.jvm.JdbcExecutor - 0 row(s) affected
21715 [main] DEBUG liquibase.ext.mssql.database.MSSQLDatabase - Executing Statement: COMMIT
21715 [main] INFO liquibase.executor.jvm.JdbcExecutor - COMMIT
21735 [main] DEBUG liquibase.executor.jvm.JdbcExecutor - -1 row(s) affected
21735 [main] INFO liquibase.changelog.ChangeSet - SQL in file
E:\\LQBASE\\LiquibaseDemo\\src\\main\\resources\\db\\changelog\\ddl\\DBSchema.sql executed
21737 [main] INFO liquibase.changelog.ChangeSet - ChangeSet
src/main/resources/db/changelog/ddl_changelog.xml::Create_DB::skini ran successfully in 18064ms
21738 [main] INFO liquibase.executor.jvm.JdbcExecutor - select schema_name()
21739 [main] INFO liquibase.executor.jvm.JdbcExecutor - SELECT MAX(ORDEREXECUTED) FROM
IND_DEV.DATABASECHANGELOG
21742 [main] INFO liquibase.executor.jvm.JdbcExecutor - select schema_name()
21744 [main] DEBUG liquibase.executor.jvm.JdbcExecutor - Release Database Lock
21745 [main] INFO liquibase.executor.jvm.JdbcExecutor - select schema_name()
21747 [main] DEBUG liquibase.executor.jvm.JdbcExecutor - UPDATE IND_DEV.DATABASECHANGELOGLOCK
SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1
21749 [main] INFO liquibase.executor.jvm.JdbcExecutor - select schema_name()
**21751 [main] INFO liquibase.lockservice.StandardLockService - Successfully released change log
lock
21752 [main] ERROR liquibase.Liquibase - Could not release lock
liquibase.exception.LockException: liquibase.exception.DatabaseException: Error executing SQL
UPDATE IND_DEV.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE
ID = 1: Invalid object name 'IND_DEV.DATABASECHANGELOGLOCK'.**
at liquibase.lockservice.StandardLockService.releaseLock(StandardLockService.java:357)
at liquibase.Liquibase.update(Liquibase.java:206)
at liquibase.Liquibase.update(Liquibase.java:179)
at liquibase.Liquibase.update(Liquibase.java:175)
at liquibase.Liquibase.update(Liquibase.java:168)
at
com.sk.liquibase.LiquibaseDemo.LiquibaseConfig.createManageIDDatabase(LiquibaseConfig.java:34)
at com.sk.liquibase.LiquibaseDemo.App.main(App.java:12)
**Caused by: liquibase.exception.DatabaseException: Error executing SQL UPDATE
IND_DEV.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1:
Invalid object name 'IND_DEV.DATABASECHANGELOGLOCK'.**
According to the error, IND_DEV (which is the DB username) is somehow being appended to the DATABASECHANGELOGLOCK table. Does anyone have any idea what the issue could be?
Sometimes if the update application is abruptly stopped, then the lock remains stuck. Possibly due to a killed liquibase process not releasing its lock
Then running
UPDATE DATABASECHANGELOGLOCK SET LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null;
against the database helps.
Or you can simply drop the DATABASECHANGELOGLOCK table, it will be recreated. or whatever changeloglock name you have configured.
On executing my SP in Jmeter as below
QueryType:Callable Statement
Query:execute [QC].[usp_GetCallCounts] ?,?,?,?,?,?
Parameter Values: 33,'12-01-2016','12-15-2016',74861,0,Evaluator
Parameter Types: INTEGER,DATE,DATE,INTEGER,BIT,VARCHAR
Request
I get this Response message: java.lang.IllegalArgumentException
Log file details are as follow:
2018-01-12 18:50:04,887 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2018-01-12 18:50:04,888 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2018-01-12 18:50:04,890 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, local)
2018-01-12 18:50:05,395 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2018-01-12 18:50:05,395 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2018-01-12 18:50:05,395 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2018-01-12 18:50:05,395 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 perThread=1000.0 delayedStart=false
2018-01-12 18:50:05,396 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2018-01-12 18:50:05,396 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2018-01-12 18:50:05,396 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2018-01-12 18:50:20,055 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2018-01-12 18:50:20,055 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2018-01-12 18:50:20,055 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2018-01-12 18:50:20,056 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, local)
Encountered the same problem today, and after debugging and removing each parameter and value one by one we found out the problem is with the DATE parameter type.
So my advice would be to replace the DATE object with an TIMESTAMP object, since that's how we have done that, and it seems to work.
Parameter Types: INTEGER,TIMESTAMP,TIMESTAMP,INTEGER,BIT,VARCHAR
As per reference doc you need to use UPPER Case names as per:
https://docs.oracle.com/javase/8/docs/api/java/sql/Types.html
So it would be :
DATE
I'm trying to (implicitly) create a temp table in SQL server 2014 (12.0.4100.1), using the following code:
proc sql;
create table UNDEAD."##_28DaysLater"n as
select * from UNDEAD.inv_overrides;
UNDEAD is an OLEDB libref, and the code is running on SAS 9.3_M2 (Windows). The error I am getting is below:
ERROR: Cursor extended fetch error: IRowset::GetNextRows failed. : The
object is in a zombie state. An object may enter a zombie
state when either ITransaction::Commit or ITransaction::Abort is called, or when a storage object was created and not yet
released.
The full log (with sastrace) is below, executed in a fresh session of Enterprise Guide (5.1).
What is actually happening here? Is it possible to prevent this error by configuration, on the SAS or SQL server side?
15 LIBNAME UNDEAD OLEDB
16 PROPERTIES=('Integrated Security'=SSPI 'Persist Security Info'=True 'initial catalog'=BDS)
17 DATASOURCE='Kernkraft400' PROVIDER=SQLNCLI11.1 SCHEMA=dbo connection=shared;
NOTE: Libref UNDEAD was successfully assigned as follows:
Engine: OLEDB
Physical Name: SQLNCLI11.1
18 OPTIONS SASTRACE=',,,d' SASTRACELOC=SASLOG NOSTSUFFIX;
19 proc sql;
20 create table UNDEAD."##_28DaysLater"n as
21 select * from UNDEAD.inv_overrides;
OLEDB_13: Prepared: on connection 3
SELECT * FROM "dbo"."inv_overrides"
OLEDB: AUTOCOMMIT turned ON for connection id 4
OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 4
OLEDB: AUTOCOMMIT turned OFF for connection id 4
OLEDB: AUTOCOMMIT turned ON for connection id 4
OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 4
NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
OLEDB_14: Executed: on connection 3
SELECT * FROM "dbo"."inv_overrides"
OLEDB: AUTOCOMMIT turned ON for connection id 3
OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 3
OLEDB_15: Executed: on connection 3
CREATE TABLE "dbo"."##_28DaysLater" ("TECH_FROM_DTTM" datetime2(3),"MSF_BK" varchar(400),"COLUMN_NM" varchar(32),"OVERRIDE_VALUE"
varchar(1000),"APPLY_IND" varchar(3),"TECH_TO_DTTM" datetime2(3))
OLEDB: AUTOCOMMIT turned OFF for connection id 3
OLEDB: *-*-*-*-*-*-* COMMIT *-*-*-*-*-*-* on connection 3
OLEDB_16: Prepared: on connection 3
INSERT INTO "dbo"."##_28DaysLater" ("TECH_FROM_DTTM","MSF_BK","COLUMN_NM","OVERRIDE_VALUE","APPLY_IND","TECH_TO_DTTM") VALUES ( ?
, ? , ? , ? , ? , ? )
OLEDB_17: Executed: on connection 3
INSERT INTO "dbo"."##_28DaysLater" ("TECH_FROM_DTTM","MSF_BK","COLUMN_NM","OVERRIDE_VALUE","APPLY_IND","TECH_TO_DTTM") VALUES ( ?
, ? , ? , ? , ? , ? )
ERROR: Cursor extended fetch error: IRowset::GetNextRows failed. : The object is in a zombie state. An object may enter a zombie
state when either ITransaction::Commit or ITransaction::Abort is called, or when a storage object was created and not yet
released.
OLEDB: Performing ROLLBACK on connection 3
OLEDB: *-*-*-*-*-*-* ROLLBACK *-*-*-*-*-*-*
OLEDB: *-*-*-*-*-*-* ROLLBACK *-*-*-*-*-*-* on connection 3
NOTE: SUCCESSFUL INSERT of 1 ROWS
WARNING: File deletion failed for UNDEAD.'##_28DaysLater'n.DATA.
Staking the existence of a grave problem on the SQL Server side, I reincarnated the table via SASWORK and the log moaned no more:
data;
set UNDEAD.inv_overrides;
run;
proc sql;
create table UNDEAD."##_28DaysLater"n as
select * from &syslast;
NOTE: Table UNDEAD.'##_28DaysLater'n created, with 4 rows and 6
columns.