h2

h2 Database performance issues with Named Query

三世轮回 提交于 2019-12-14 03:55:59
问题 Just some pre-information. We are using a H2 File Database which is already around 15 GB. Our Application runs on Windows Clients Jetty Webserver H2 File Database Every time Data needs to be updated on client side, the user will get a zip File with XML-Files. Either an XML file will be imported to the DB or the xml file has a flag "delete" and the entry in the DB will be deleted. Every import of a zip file has a data version. The import is done manually with Java. XML Files are deserialized

Caused by: java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.ada

六眼飞鱼酱① 提交于 2019-12-14 03:41:58
问题 I have an application with Jboss, Seam, Hibernate and h2. I wrote a simple action for importing data to the database from an external file. @Name("importAction") @AutoCreate @Scope(ScopeType.CONVERSATION) @Transactional public class ImportCosAction extends AbstractAction { saveOrUpdate(member); protected void saveOrUpdate(AbstractEntity entity) { final Session session = getSession(); session.saveOrUpdate(entity); flushSession(); } It works as expected for number, however, at some point I get

Java-based H2 Database cannot locate items in CLASSPATH

南楼画角 提交于 2019-12-13 21:11:57
问题 I have a scala file has been compiled with the following command: scalac -cp ".:*" AcmeTrigger.scala In the directory with the .scala file I have some .jar files that contain the APIs for email and texting services that I'm using. No issues here. The scala file essentially sends text messages and emails when someone modifies a table in a database. I start the database with the following command: java -cp ".:*" -jar h2-1.4.182.jar Essentially telling it to use the the .class and .jar files in

How to compress memory space of h2 database ( in-memory mode)?

我的梦境 提交于 2019-12-13 18:34:01
问题 h2 seems to take up too much memory space, How to compress it 回答1: Do you use the in-memory mode (database URL jdbc:h2:mem:test or similar)? H2 uses a pluggable file system / file system abstraction, and as part of that there is are two in-memory file system implementations, one of them compresses the data. To use it, use one of the following database URLs: jdbc:h2:memFS:test (regular in-memory file system; a bit slower than jdbc:h2:mem:test but uses a bit less memory) jdbc:h2:memLZF:test

Keep two databases synchronized with timestamp / rowversion

泪湿孤枕 提交于 2019-12-13 18:06:15
问题 I have a primary database containing table A and a secondary database containing another copy of A. Each time my application starts it checks all the rows of table A in the primary database and updates the rows of A in secondary database. The need for this ugly behaviour is support for a legacy database however this operation on each start is starting to be very cpu expensive. I have found out a timestamp (also called row version by Microsoft) can store when rows have been updated. My

错误日志(远程调用整合Spring boot---数据库异常)

三世轮回 提交于 2019-12-13 17:16:59
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put it on the classpath. If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active). 无法配置DataSource:未指定 URL 属性,也无法配置嵌入数据源 就是你在应用中没有配置datasource的一些相关属性 都知道,SpringBoot的最大一个好处就是自动配置:所以我们只是需要给他配置文件的值,它就会自动配置。配置在application.yml文件中

Generic error [50000-175] caused by NullPointerException

烂漫一生 提交于 2019-12-13 14:25:44
问题 I am using H2 database in client-server mode. Server is running with version 1.3.175 and client with 1.3.168. Everything seems working fine, but I get an exception executing some queries: org.h2.jdbc.JdbcSQLException: General error: "java.lang.NullPointerException" [50000-175] at org.h2.message.DbException.getJdbcSQLException(DbException.java:332) at org.h2.message.DbException.get(DbException.java:161) at org.h2.message.DbException.convert(DbException.java:284) at org.h2.server

SonarQube default credentials for internal H2 db?

六眼飞鱼酱① 提交于 2019-12-13 14:12:26
问题 I'm running SonarQube 5.6.1 and am trying to save a view that I created. To do that, I want to take a peek at H2 DB that Sonar (according to it's own readme) uses for internal embedded DB. I've ran the H2 jar file and in console was able to log in to dummy DB. If SonarQUbe is running, I can't connect. So, what are default credentials for that DB? Tried my user credentials and admin/admin, none work. Admin/admin is default for SonarQube administrator user. 回答1: The default values are sonar

How to create stored procedure using H2 database?

孤街醉人 提交于 2019-12-13 11:53:11
问题 Has anyone tried to create stored procedures using the H2 database? 回答1: To access the database within a Java function, you do need a connection. For H2, there are two ways to get such a connection: Solution 1 : If the first parameter of the Java function is a java.sql.Connection , then the database provides the connection. For SQL, this is a 'hidden' parameter, meaning you can't and don't need to set it explicitly. This is documented: User-Defined Functions and Stored Procedures, "Functions

Recursive CTE don't work when recursion predicate uses a bind variable

血红的双手。 提交于 2019-12-13 08:51:04
问题 When using recursive CTE in H2 (I know, experimental feature), the following query doesn't work: Connection con = getConnection(); System.out.println("Wrong result:"); PreparedStatement stmt = con.prepareStatement( "WITH recursive t(f) AS ( "+ " SELECT 1 "+ " UNION ALL "+ " SELECT t.f + 1 "+ " FROM t "+ " WHERE t.f < ? "+ ") "+ "SELECT t.f "+ "FROM t " ); stmt.setInt(1, 10); ResultSet rs = stmt.executeQuery(); while (rs.next()) System.out.println(rs.getInt(1)); The produced output is: 1 The