Rocky.Hu | 18 Sep 08:00 2014

how to view the trace log

Hi:

 

                I had been add the derby.properties file into the %DERBY_HOME%\binand I used the Derby in client/server mode, when I started and visited the database, it also procedure a file named Server1.trace in the %DERBY_HOME%¥bin, but I opened the file, I couldn’t get any information because it was garbled, so how can I viewed the trace?

 

Thanks,

Rocky

Bob M | 17 Sep 05:16 2014
Picon

Derby Error message - explanation required

I have a java program which uses derby in embedded mode......................

Everything was working fine until my laptop had a meltdown and I have had to
go back to factory settings and reinstall software etc.

Everthing ( Derby database, tables etc.) is setup as before except that I
have added a User Name and Password to my derby database.

The error I am getting is as follows:-

DerbyApp starting in embedded mode
Loaded the appropriate driver
----- SQL Exception ------
SQL State: XJ040
Error Code: 40000
Message: Failed to start database'C:\...........' with class loader
com.dukascopy.dd2.greed.agent.compiler.c <at> 2245f804, see the next exception
for details
----- SQL Exception ------
SQL State: XJ001
Error Code: 0
Message: Java exception:':java.lang.NullPointerException'.

Can anybody suggest what I have wrong in simple English :)

Thanks

Bob M

--
View this message in context: http://apache-database.10148.n7.nabble.com/Derby-Error-message-explanation-required-tp142183.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

bfabec | 12 Sep 17:29 2014
Picon

CLOB data errors after moving cursor around

Hello All! 

The version we are running is a bit older (10.8.2.2), but I have tried
latest version of Derby  <at>  10.11.1.1 with it's JDBC drivers that are included
with it.  I am having problems with CLOB after moving the cursor
forward/backwards. The CLOB(s) themselves are roughly 500000+ characters
each.

Sample Code:
-------------------------------------------------------------------------------------------
import java.sql.Clob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class testZ {
	private static String dbURL =
"jdbc:derby://9.42.11.34:1527/TestDB;create=true;user=test;password=test";
	
	public static void main(String[] args) {
		try {
			Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
			Connection conn = DriverManager.getConnection(dbURL);
			conn.setAutoCommit(false);
			Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
			ResultSet rs = stmt.executeQuery("select * from TESTCLOB where
EVENTID=30266");			
			rs.last();
			System.out.println(rs.getRow());
			rs.first();
			
			Clob clob = rs.getClob("GROUPASC");
			int len = (int) ((java.sql.Clob) clob).length();
			String clobData = ((java.sql.Clob) clob).getSubString(1, len);
			System.out.println("Clob Data: " + clobData);			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
---------------------------------------------------------------------------------------------

Notice I am moving the cursor around. I wanted to get the size of the result
set prior to getting the Clob data. So I do a rs.last() and rs.getNum() to
get the size of the result set. I then move the cursor back to the first row
and obtain the Clob data for first row. If I remove the rs.first() statement
and get the Clob data of the rs.last() row, it works fine.  It seems as long
as I go forward (not backwards), the CLOB data is retrievable. Note from the
code, I am using ResultSet.TYPE_SCROLL_SENSITIVE. I have tried
TYPE_SCROLL_INSENSITIVE, but with the same problem.  I also tried
enabling/disabling the auto commit, also still have this error. For this
code, I am getting the following error:

java.sql.SQLException: You cannot invoke other java.sql.Clob/java.sql.Blob
methods after calling the free() method or after the Blob/Clob's transaction
has been committed or rolled back.
	at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown
Source)
	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
	at org.apache.derby.client.am.ClientClob.length(Unknown Source)
	at testZ.main(testZ.java:25)
Caused by: ERROR XJ215: You cannot invoke other java.sql.Clob/java.sql.Blob
methods after calling the free() method or after the Blob/Clob's transaction
has been committed or rolled back.
	at
org.apache.derby.client.am.CallableLocatorProcedures.handleInvalidLocator(Unknown
Source)
	at
org.apache.derby.client.am.CallableLocatorProcedures.clobGetLength(Unknown
Source)
	at org.apache.derby.client.am.ClientClob.getLocatorLength(Unknown Source)
	at org.apache.derby.client.am.Lob.sqlLength(Unknown Source)
	... 2 more
Caused by: ERROR 38000: The exception 'java.sql.SQLException: The locator
that was supplied for this CLOB/BLOB is invalid' was thrown while evaluating
an expression.
	at org.apache.derby.client.am.ClientStatement.completeExecute(Unknown
Source)
	at
org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown
Source)
	at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown
Source)
	at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown
Source)
	at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown
Source)
	at org.apache.derby.client.am.ClientStatement.readExecuteCall(Unknown
Source)
	at org.apache.derby.client.am.ClientPreparedStatement.flowExecute(Unknown
Source)
	at org.apache.derby.client.am.ClientPreparedStatement.executeX(Unknown
Source)
	... 5 more
Caused by: ERROR XJ217: The locator that was supplied for this CLOB/BLOB is
invalid
	at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
	at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
	... 13 more

--
View this message in context: http://apache-database.10148.n7.nabble.com/CLOB-data-errors-after-moving-cursor-around-tp142101.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Rony G. Flatscher (Apache | 12 Sep 12:37 2014
Picon

Question ad JDBC driver, maybe DriverManager and derby ...

Hi there,

tried to find this information on the Internet, but also in the derby wiki, but was not successful so far, hence posting this question here where hopefully those in the know can help out.

Using derby from Oracle's JDK 7 distribution I encountered a problem and after a loong time of research, testing, trials and errors I came up with a solution, but still do not understand the reason for the problem!

Here is the problem:
  • having a class from a jar that is placed in one of the java.ext.dirs loading the derby JDBC  (to be precise: 'org.apache.derby.jdbc.EmbeddedDriver' and then issuing a newInstance()) from the classpath works, but the subsequent java.sql.DriverManager.getConnection('jdbc:derby:derbyDB;create=true',props) where 'props' is a java.util.Properties with "user1/user1" and "password/user1", yields:
    getCause(): [java.sql.SQLException: No suitable driver found for jdbc:derby:derbyDB;create=true]

The same program works without any changes,

  • if the jar-file loading the derby JDBC is not in java.ext.dirs but on the classpath then it works
  • if the jar-file and derby.jar are both in java.ext.dirs then it works

My question is, why is this so?

(It seems to be the case that both, the Java class that loads the derby JDBC driver and the derby JDBC driver, must use the same class loader, either a sun.misc.Launcher$AppClassLoader or a sun.misc.Launcher$ExtClassLoader, which is very strange as I have not encountered a similar requirement/behaviour in any other use case in the past years. The thread context class loader is the application class loader which, if used, would have found derby.jar given on the classpath.)

Is there any documentation that leads to an explanation about this behaviour somewhere? Are there other Java infrastructures that have such a restriction that anyone is aware of?

---

Background: I am authoring a scripting language binding for Java (BSF4ooRexx) and moving the BSF4ooRexx jar to a Java extension directory makes it available to all Java applications including the JavaPlugins for browsers. All test and sample programs work in this setup, except for the sample program that demonstrates how easy it is to use derby via JDBC! :(

---

Thankful for any pointer, hints, links, explanations that shed some light into this corner!

---rony


jamsterdam | 12 Sep 01:14 2014
Picon

Boot derby with missing containers, ERROR 40XD2

Hi all,

I accidentally deleted a few of the disk pages files in /seg0 and now I get
the following error when trying to start the database: 

ERROR 40XD2: Container Container(0, 560) cannot be opened; it either has
been dropped or does not exist.

Is there a way to force boot the database even though the data may be
inconsistent? I don't think the data was backed up ever before, or at least
I cannot find where it could have been backed up.

Any suggestions?

--
View this message in context: http://apache-database.10148.n7.nabble.com/Boot-derby-with-missing-containers-ERROR-40XD2-tp142077.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Raffaele Sgarro | 8 Sep 19:15 2014
Picon

Improving performance of encrypted databases by increasing page cache

Database encryption turned out to be the performance bottleneck of my application. Running the same queries on the same data gives very different figures when the database is encrypted. Since I must keep the data encrypted on disk, I thought I could avoid the decryption overhead by increasing the page cache and warming up the cache by loading tables and indices at application startup. Virtually, I want to run queries against in-memory tables and indices. I run the Derby network server in its own dedicated VM process, gave the JVM 1GB of heap, and configured 400MB of page cache (4KB page size * 100K pages), database backup being 200MB.

The performance gain is really impressive (as expected) once the cache has been warmed. Unfortunately, a quick test showed there must be lots of cache misses with real usage patterns. I wonder if it's simply a matter of sizing the cache (but how can 200MB of db not fit into 400MB of memory? Are record compressed on disk?), or if it doesn't work the way I think, and I should use a cache at the application level (that maybe I'll do anyhow, but if it workd, it'd be a big win for us)

Raffaele
Kessler, Joerg | 9 Sep 10:20 2014
Picon

Problem with Select statement

Hi,

I want to execute select statement on a table using a Java program and JDBC. The statement is actually not very difficult:

SELECT MSG_NO, SEND_TO, CREATED_TIME, CONTENT, ENCRYPTION_KEY FROM TESTTABLE  WHERE SEQ_ID = ? AND (MSGSTATE IS NULL OR MSGSTATE = 'A')

When this statement is executed by a test I receive errors like

 

Column 'A' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'A' is not a column in the target table.

 

When I change the statement to

SELECT MSG_NO, SEND_TO, CREATED_TIME, CONTENT, ENCRYPTION_KEY FROM TESTTABLE  WHERE SEQ_ID = ? AND MSGSTATE IS NULL

there is no problem. Also when I execute the above statement via Eclipse Database Development/SQL Scrapbook using a fix SEQ_ID the statement is executed without error.

 

What am I doing wrong?

 

Best Regards,

 

Jörg

Tim Dudgeon | 29 Aug 17:17 2014

NPE from InternalTriggerExecutionContext.cleanup()

Using Derby 10.10.1.1 I'm seeing strange behaviour when doing a series 
of inserts that have triggers associated.
About 2000 rows get inserted fine, then it blows up completely.
The derby.log file contains stuff like this:

Database Class Loader started - 
derby.database.classpath='APP.ExtraFunctions'
Loaded chemaxon.misc.derby.functions.MiniregFunctions from database jar 
"APP"."EXTRAFUNCTIONS"
Fri Aug 29 15:37:56 BST 2014 Thread[Default RequestProcessor,1,system] 
(XID = 448992), (SESSIONID = 1), (DATABASE = 
C:\Users\timbo\Documents\IJCProjects\mini-regs\Vanilla 
Oracle/.config/derby-minireg-11-jun/db), (DRDAID = null), Cleanup action 
starting
Fri Aug 29 15:37:56 BST 2014 Thread[Default RequestProcessor,1,system] 
(XID = 448992), (SESSIONID = 1), (DATABASE = C:\Users\ ... ), (DRDAID = 
null), Failed Statement is: INSERT INTO APP.COMPOUNDS ( ... ) VALUES 
(?,?,?,?,?,?,?,CURRENT_TIMESTAMP,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) 
with 31 parameters begin parameter #1: BLOB:Length=1658 :end ...
java.lang.NullPointerException
	at 
org.apache.derby.impl.sql.execute.InternalTriggerExecutionContext.cleanup(Unknown 
Source)
	at 
org.apache.derby.impl.sql.execute.TriggerEventActivator.cleanup(Unknown 
Source)
	at org.apache.derby.impl.sql.execute.InsertResultSet.cleanUp(Unknown 
Source)
	at 
org.apache.derby.impl.sql.conn.GenericStatementContext.cleanupOnError(Unknown 
Source)
	at 
org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown 
Source)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown 
Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown 
Source)
	at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown 
Source)
	at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown 
Source)
	at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown 
Source)
...

(somethings cut out for brevity)

The trigger involved uses a custom java function that's been added to 
the DB, so the real problem might well be there, but the stack trace 
doesn't give much of a pointer.

Any suggestions for where to look?

Tim

Rick Hillegas | 27 Aug 14:40 2014
Picon

[ANNOUNCE] Apache Derby 10.11.1.1 released

The Apache Derby project is pleased to announce feature release 10.11.1.1.

Apache Derby is a subproject of the Apache DB project. Derby is a pure 
Java relational database engine which conforms to the ISO/ANSI SQL and 
JDBC standards. Derby aims to be easy for developers and end-users to 
work with.

Derby 10.11.1.1 can be obtained from the Derby download site:

    http://db.apache.org/derby/derby_downloads.html.

Derby 10.11.1.1 contains the following new features:

     * MERGE statement - MERGE is a single, join-driven statement which 
INSERTs, UPDATEs, and DELETEs rows.
     * Deferrable constraints - Constraint enforcement can now be 
deferred, typically to the end of a transaction.
     * WHEN clause in CREATE TRIGGER - An optional WHEN clause has been 
added which determines which rows fire a trigger.
     * Rolling log file - The Derby diagnostic log can now be split 
across a sequence of files.
     * Experimental Lucene support - Derby text columns can now be 
indexed and queried via Apache Lucene.
     * Simple case expression - The "simple" and "extended" syntax for 
CASE expressions has been added.
     * Better concurrency for identity columns - The concurrency of 
identity columns has been boosted.
     * New ij HoldForConnection command - A new ij command has been 
added to change the default cursor holdability.
     * Standard syntax for altering column nullability - Standard syntax 
has been added for altering the nullability of columns.

In addition, Derby 10.11.1.1 contains many bug, security, and 
documentation fixes.

Please try out this new release.

Myrna van Lunteren | 25 Aug 05:28 2014
Picon

10.11.1 release candidate delayed

I found this message stuck in moderation and my attempt to moderate it through failed.

George,

Looks like the 10.11 release is really close. There were some delays because of vacation times and the testing exposed some bugs that had to be fixed first.

The Release Manager set the new Target Release date for August 29.

Myrna

-----------------------------------
From: spykee <toma.george89-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
To: derby-dev-PvNy6fhA98DNLxjTenLetw@public.gmane.org
Cc: 
Date: Tue, 5 Aug 2014 10:21:43 -0700 (PDT)
Subject: Re: 10.11.1 release candidate delayed
Hi folks,

Any news with the release ?

Cheers,
George
Myrna van Lunteren | 25 Aug 05:14 2014
Picon

How to get Derby folder size from remote Server?

This message was stuck in moderation also; my attempt to moderate it through failed.
---------------

From: Nguyen Hai Dong <dongngh-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
To: derby-user-PvNy6fhA98BaOpEYXzEtiA@public.gmane.orgrg
Cc: 
Date: Mon, 21 Jul 2014 00:26:59 -0700 (PDT)
Subject: How to get Derby folder size from remote Server?
Hi,

My java application and Database is running in different servers. How can i
get whole *database folder size* in java program. Thanks.

Gmane