Warning when using Apache Derby in memory - derby

I have a number of unit tests, which use Apache Derby in memory.
My connection url is: jdbc:derby:memory:srf.derby;create=true
I discovered that each time, when a method marked as #Transactional is finishing, I receive a Derby warning
12:53:28:5328 [org.hibernate.util.JDBCExceptionReporter] [main] WARN - SQL Warning: 10000, SQLState: 01J01
12:53:28:5328 [org.hibernate.util.JDBCExceptionReporter] [main] WARN - Database 'memory:srf.derby' not created, connection made to existing database instead.
Why is it? What I'm doing wrong?
Thank you

You're not doing anything wrong. You're passing ';create=true' each time, but the database is only created the first time your program accesses it. Since it's in-memory, the database then hangs around until your program exits, at which point it disappears.
You could avoid the warning by passing ';create=true' only on the first test in your test suite, and then subsequent tests do not need to pass that value.
Or, you could just not worry about the warning.

Related

Test connection of h2 database

I tried to test the connection on h2 console and got this error:-
The error with code 50000 is thrown when something unexpected occurs, for example an internal stack overflow. For details about the problem, see the cause of the exception in the stack trace.[General error: "java.lang.IllegalStateException: Unable to read the page at position 6322192528771 [1.4.200/6]" [50000-200] HY000/50000 (Help)][1]
Your database file is corrupted. If you need data from it, you can try to use the recovery tool. If you don't need it, you can simply delete test1.mv.db in the home directory of your user account.
When you use persistent embedded databases in H2 you should be careful with them, Thread.interrupt() may corrupt the database file, for example, unless you're using the async: filesystem. Corruption is also possible when you open the database file from a recent version of H2 with older one. The default MVStore engine also has some own problems.

Frequent ORA-4068 Error in webLogic 12c after rebuilding the package in Oracle

I am running my web application WAR in WebLogic 12c. I configured my JNDI JDBC Data Source using Data Source option at admin console. Everything was working fine until I removed some privileges from stored procedures. After that I am getting error ORA-04068: existing state of packages string has been discarded.
But nothing is able to solve the issue. Could any one please suggest me any resolution to the above issue ? Any help would be appreciated.
1. Clear the statement cache in webLogic
2. Reset the connection in webLogic
3. Set Statement Cache Size to 0
4. Finally restart the server using command line
5. Deleted the conflicting package
You may be able to use the SERIALLY_REUSABLE pragma on the package spec/body to limit this problem. This may incur a bit of a performance hit. Also, you cannot use this method if the package has variables whose state needs to be retained between different sessions calling the package.
More details here.
Finally I am able to solve this issue. It was because of timestamp mismatch error in Oracle Database. Resolution found here

Can not load large amounts of data with DataGrip or IntelliJ to PostgreSQL

I use datagrip to move some data from a mysql installation to another postresql-database.
That worked for 3 other tables like a charm. The next one, over 500.000 rows big, could not be imported.
I use the function "Copy Table To... (F5)".
This is the log.
16:28 Connected
16:30 user#localhost: tmp_post imported to forum_post: 1999 rows (1m
58s 206ms)
16:30 Can't save current transaction state. Check connection and
database settings and try again.
For other errors like wrong data types, null data on not null columns, a very helpful log is created. But not now.
The problem is also relevant when using the database plugin for IntelliJ-based IDEs, not only DataGrip
The simplest way to solve the issue is just to add "prepareThreshold=0" to your connection string as in this answer:
jdbc:postgresql://ip:port/db_name?prepareThreshold=0
Or, for example, if you a using several settings in the connection string:
jdbc:postgresql://hostmaster.com:6432,hostsecond.com:6432/dbName?&targetServerType=master&prepareThreshold=0
It's a well-known problem when connecting to the PostgreSQL server via PgBouncer rather than a problem with IntelliJ itself. When loading massive data to the database IntelliJ splits data into chunks and loads them sequentially, each time executing the query and committing the data. By default, PostgreSQL starts using server-side prepared statements after 5 execution of a query.
The driver uses server side prepared statements by default when
PreparedStatement API is used. In order to get to server-side prepare,
you need to execute the query 5 times (that can be configured via
prepareThreshold connection property). An internal counter keeps track
of how many times the statement has been executed and when it reaches
the threshold it will start to use server side prepared statements.
Probably your PgBouncer runs with transaction pooling and the latest version of PbBouncer doesn't support prepared statements with transaction pooling.
How to use prepared statements with transaction pooling?
To make prepared statements work in this mode would need PgBouncer to
keep track of them internally, which it does not do. So the only way
to keep using PgBouncer in this mode is to disable prepared statements
in the client
You can verify that the issue is indeed because of the incorrect use of prepared statements with the pgbouncer via viewing IntelliJ log files. For that go to Help -> Show Log in Explorer, and search for "org.postgresql.util.PSQLException: ERROR: prepared statement" exception.
2022-04-08 12:32:56,484 [693272684] WARN - j.database.dbimport.ImportHead - ERROR: prepared statement "S_3649" does not exist
java.sql.SQLException: ERROR: prepared statement "S_3649" does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
at org.postgresql.jdbc.PgConnection.executeTransactionCommand(PgConnection.java:755)
at org.postgresql.jdbc.PgConnection.commit(PgConnection.java:777)

Confusion in configuration of SonarQube with PostgreSQL DB

I have SonarQube 5.6 version installed and RDS PostgreSQL DB connected to it on AWS. I have this setup since a long time and many projects run on every day schedule on SonarQube. Not getting any issue or errors there. but looks like my Database configuration is not correct. because when i looked into Database. I don't see much more movement or anything stored there. I have updated conf/sonar.properties files with database endpoint and credentials. It looks like it's connected. How to make sure this? like, my database is getting used by sonarqube?
Because sonarQube documentation is saying, No database required after 5.2 version.
can someone please explain me architecture, What is right way to setup this?
I am getting an error as follow,
INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:postgresql:sonarprod.cyfa9ycgfky0.us-east-1.rds.amazona‌​ws.com 2017.02.24 19:54:03
ERROR web[o.a.c.c.C.[.[.[/]] Exception sending context initialized event to listener instance of class org.sonar.server.platform.PlatformServletContextListener java.lang.IllegalStateException: Can not connect to database. Please check connectivity and settings (see the properties prefixed by 'sonar.jdbc.').
I have checked everything is correct in connection string, username, password. all looks correct to me. I have specific ports open for communication. what does this error means? what am i missing?
Thanks in Advance.
You can see which database is used by SonarQube by having a look at server's log.
For instance, here's the entry you'll find when PostgreSQL is used :
2017.02.15 16:46:39 INFO web[][o.sonar.db.Database] Create JDBC data source for jdbc:postgresql://localhost:5432/sonar

List of Weblogic Error Codes

Context
I have been debugging an Oracle Weblogic Server 10.3.0.0 JDBC Connection which is logging the error code:
BEA-001112
After some searching around I found a bit of an explanation here:
http://docs.oracle.com/cd/E21764_01/core.1111/e10106/dbac.htm#BHCFFAJF
Although it does depend on the actual exception being thrown, I believe this means:
there was an error when testing a new connection in the JDBC Connection Pool before handing it off to be used by the application.
Question
Does anyone know of a list of Weblogic Error Codes that has a general description for the specific Error Code?
In Oracle portfolio WebLogic is a part of Oracle Fusion Middleware (OFMW). Thus the error code (or message) list is a part of OFMW documentation.
As the links a quite difficult to find for uninitiated here's direct links to a few different releases.
WebLogic 10.3.3
WebLogic 10.3.6
WebLogic 12.1.3
They are not much descriptive, but hopefully can give you at least an introduction. You can also index them by subsystem. Clicking on a message (or message range) will bring up the details.
Cause: The specified data source connection pool has been configured with one or
more attributes to test the pool connections. One of those test attempts failed. The
associated error is printed.
Action: Check the associated error to see what the problem is and correct it.
Normally, this indicates that a connection was lost to the database (the database is
down). This needs to be corrected by the database administrator.

Resources