Hi Thomas,
This is great progress!
It seems to me that you have identified several places where we could improve
the Derby documentation.
And your experience with the database properties versus system properties
seems unexpected to me; I think as you do that this feels like a flaw in Derby,
[derby][SQLException@22c95b] Message= Connection authentication failure
occurred. Reason: userid or password invalid.
Perhaps more information is available in the derby.log file that the network
server produced. Can you post the contents of that file?
Also, I think that this line:
08004 with the message 'invalid athentication..'. Hard to believe that
the network client driver is not working, whereas the embedded driver does!?
I wonder if, for some reason, the network server isn't seeing the authentication
properties that you have set, and so is not doing LDAP
IJ commands work well in IJ command line, including show and describe. That
means if I connect derby by IJ, there is no problem.
Currently, the problem occurred in Eclipse inside. And I just blocked by *show*
and *describe* commands so far. Other commands I
ever used work well.
Hmmm. I'm
On 01/03/2011 09:56 PM, Bruce Wen wrote:
I used derby eclipse plugin from
http://db.apache.org/derby/releases/release-10.7.1.1.cgi.
I think that the best course of action here would be for you to file a new
issue in Jira, including the information that you've provided in this email
thread so
I used /eclipse-jee-ganymede-SR2-win32/ and it contains Apache Derby plug-in in
default. However, when I execute /describe
table_name/ statement, /syntax error:Encountered describe// at line 1, column
1/ is encountered unexpectedly. And /show
schemas/ statement also not workable because of the
On 12/30/2010 07:03 AM, Thomas wrote:
After many hours of further investigation I have been able to overcome all road
blocks and now successfully use SSL certificates (created and signed using
openSSL and converted in jks keystores using keytool) and peer Authentication
between server and
I'm trying to debug a strange error that just started occurring recently.
I think you've done a great job trying to identify the causes and triggers
of this problem.
I think you should open a new JIRA issue and start working directly with the
Derby developers. It seems possible that you are
the problem now is that if I run login server with embeddeddriver, and
client with clientdriver, once the client tries to connect to to the
database it raises an error saying that maybe another instance of derby is
running the server.
The embedded driver uses a lock file to detect two copies of
there is a way to connect to the db with IJ, using ClientDriver? I want to
see within ij it works or not..
You bet!
In fact, you'll probably feel a lot more comfortable working with Derby if
you take some time now to get more comfortable with the built-in Derby tools,
such as ij, and the
On 12/07/2010 12:15 PM, John English wrote:
Can anyone explain what this means? It occurs when I issue what should
be a straightforward insert:
INSERT INTO resource_usage (resid,xmlid,xmltable)
(SELECT resid,?,? FROM resource_usage WHERE xmlid=? AND xmltable=?)
The select returns 64 results,
My app is made of a login-server connected with embeddeddriver to the derby,
and another server that needs to connect too to the database.
You can use what is called the Embedded Server, where one program directly
accesses the database using the embedded driver, while that same program
also
FOREIGN KEY(id) REFERENCES thread(idThread) ON UPDATE CASCADE,
Derby hasn't implemented ON UPDATE CASCADE. Here's what Derby provides:
http://db.apache.org/derby/docs/10.6/ref/rrefsqlj16357.html
ps: In another thread I've a pending message. I've done all I could
(followed the
reading the last link you posted, about classpath usage, I had some doubts
about my server startup, so here is the entire command I run for the server:
java -classpath :/home/user/app/lib/derbyrun.jar:/home/user/app/shared/
-Djava.rmi.server.codebase=file:///home/user/app/shared/
- Informazioni su Derby
JRE - JDBC: Java SE 6 - JDBC 4.0
[/home/user/app/lib/derby.jar] 10.6.2.1 - (999685)
[/home/user/app/lib/derbytools.jar] 10.6.2.1 - (999685)
--
What the above tells me is that your classpath is OK. The
java -classpath :/home/user/app/lib/*:/home/user/app/shared/
Do I have to change this? I thought I already set it up properly :\ as you
can see in the classpath there's the path to derby (inside the lib folder),
maybe the * part is wrong. You think i need to specify the complete path
Class.forName(org.apache.derby.jdbc.EmbeddedDriver).newInstance();
the DBMS call is inside a method of the server, which is called remotely by
the client (thinks it's the cause of the RemoteException). to run the server
I use these classpath/codebase parameters:
java
The strange thing is, that if i load the import.sql file manually, using
Derbys ij prompt, it loads without error, even in the Derby db created by
Hibernate.
I'm not Hibernate-fluent, but one thing I often encounter when designing
and testing mechanisms like this is that some import systems
To turn autocommit off, call Connection.setAutoCommit(false); Here's some docs:
http://download.oracle.com/javase/1.4.2/docs/api/java/sql/Connection.html
If you don't turn autocommit off, you will indeed discover that the automatic
commit process can close various cursors and result sets at
I need to support using two or more applications that can reference /MY_DB/.
The Embedded Server Mode should support this:
It is fine to have two or more applications accessing the same DB.
But you need to have exactly one network server.
So, you have two choices:
1) Start a single network
a bit of resources. So it's good to keep in the habit of closing them
as soon as possible.
OK; lots more try/finally blocks needed, then!
Unfortunately true, at least for now.
I've read that this will be improved in JDK 1.7 / JDBC 4.1, though:
Obviously there must be something wrong with this code, but I cannot
see what it is. Should I perhaps be closing the (empty) result set to
commit the transaction?
To commit your transaction, you need to call Connection.commit() (or put
your connection into auto-commit mode). Closing your result
wrong problem. I don't really understand the details of what the
lock table dump is telling me,
It does take a bit of practice to learn how to read the information,
although I suspect you're not looking for basic introductory info
at this point. Still, this is a place to start:
I normally leave autocommit turned on, but in a few places in my code I
wrap multiquery transactions like this:
try {
setAutoCommit(false);
... // do a bunch of related updates
}
finally {
commit();
setAutoCommit(true);
}
Is this the right way to do it, and would the behaviour I see have to be
ij to connect the derby still fail. The java process still running and
derby can not response normally.I didn't do any special configuration
for derby. Just start it using: $DERBY_HOME/bin/startNetworkServer -h
localhost -p 1527.
A good place to start is to look in the derby.log file of the
On 09/10/2010 02:48 AM, Chris Wilson wrote:
I'd like to be able to use a column alias (from the column list of the
SELECT statement) in the HAVING clause.
...
Derby clearly knows this, as using the expression instead of the alias
works:
After fairly extensive discussion (see this issue for a
I basically don't have a good understanding of what the tmp/ directory
is used for, or when it's created or goes away.
I suspect that you are encountering some sort of resource exhaustion
situation, which is provoking a Derby bug of some sort.
The tmp directory is used by the low-level storage
I hope this is the place to post such issues. I've recently renamed an
identity column, and then found that it no longer functioned as one;
That's DERBY-4693, I believe: https://issues.apache.org/jira/browse/DERBY-4693
It's fixed in the 10.6 branch, so you could build the fix for your own use.
Hi, all. Could you point me to a page, or just tell me, what
configuration settings I can tweak to reduce the overall memory
footprint of a booted Derby database. Losing performance is pretty much
OK, this is not a time-critical part of our code, but I have a lot of
databases open and it's
Now, I have remarked that creating an index on column 'SOMEDATA'
is sufficient to remove the deadlock.
I think an alternate approach would be to commit the insert, then
perform the select in a separate transaction.
And yet a third way, I believe, would be to set your transaction
isolation to a
Caused by: ERROR XCL13: The parameter position '3' is out of range. The
number of parameters for this prepared statement is '2'.
...
Any direction or feedback as to where I should look to resolve this
issue would be greatly appreciated. If more detail is needed such as a
I'm not sure where
It is observed that, if derby database runs continuously for say around 5 hrs.
It becomes really slow for further queries even with fresh DB calls.
Unless you are adding data dramatically fast, I don't think you should need
to do cleanup or maintenance on the database itself very frequently.
On 05/17/2010 03:52 AM, Marcin Krol wrote:
The thing is I'm frequently getting ShutdownExceptions when
printoutResultSet is executing.
I don't see anything obvious in the code you attached that
would cause this.
Try printing out the full exception trace:
But my preference to deploy the program as a single file, so that the user
can run it simply with:
java myprogram [parameters]
without having to set CLASSPATH.
You can try using the manifest Class-Path:
http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html
thanks,
bryan
On 05/04/2010 07:54 PM, Fabricio Pedroso Jorge wrote:
Thats the problem: i simply can't connect mai client to the server..
On your server machine, when starting the Network Server, did you
pass the '-h' argument?
If you didn't, that's probably the problem.
thanks,
bryan
I've been experiencing intermittent errors in derby.log that look like this:
Caused by: java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:485)
at org.apache.derby.impl.store.raw.log.LogToFile.flush(Unknown
What problem I have is, the application can run for the first time, but
for the second time, it can not been completed because that derby will
be very slow.
Do you completely exit and re-start the application between these two runs?
If not, then perhaps the application is not entirely freeing
Another issue I'm seeing is, because I regularly shut down and then
reboot the database (this is to keep resource usage low), the derby.log
file is continually growing with shutdown/reboot messages.
Are you shutting down and rebooting the *database*, or shutting down
and restarting the
As it is a lot of data that needs to be transferred between tables, the
idea of using the system procedures to export the data from the source
table, and then importing it in the target table appears to be good one.
I will definitely give it a try, and will post the code here if I
encounter
Thanks for providing the script! It is very clear.
As Knut Anders suggested, if I add 'set role reader;' at line 96 of the script,
user Thomas is then able to select from SecureView.
thanks,
bryan
Somebody has given me a Derby database with some unknown indexes in. I can
work out the names of all the indexes on this database, but I would like to
know the names of the columns which make up the indexes.
Open the database using ij and use the 'describe' and 'show indexes' commands.
thanks,
view. My expectation is that user X via having been granted the role should
be able to select data from the view.
Seems that way to me, too.
Could be a bug.
It seems worth it for you to post a complete example, so others can try it
and see if we can replicate your results.
thanks,
bryan
Jamil Shreet wrote:
How do I build Derby using JDeveloper?
Do you mean how to build Derby from source code? Or how to build
applications that use Derby?
You can write JDBC applications that use Derby with any tool; Derby
conforms to the JDBC standard. To run a JDBC application against Derby
I think this could be a case where the query optimizer could use some
work? Is it useful for me to file a bug report somewhere, e.g. in JIRA?
Yes, it would be particularly helpful if you could provide a complete
standalone test case which demonstrates the problem.
If that's not possible, then
My question is any reason why the database responding (select /inserts)
becomes slower as the database usage becomes more.
If you can observe the performance impact in a reliable
and reproducible fashion, you could try:
1) Set up the fast-responding behavior
2) Capture runtime statistics from
By placing that try block into ASTParser.execute(), you're arranging it
so that this line always gets run at the end of execute():
DriverManager.getConnection(SHUTDOWN_URL);
This line is shutting the Derby system down, and it means that the
next time you try to run the parser, you get the
Finally, I have both query plans, one for:
(Executed successfully in 0.959 s.)
http://witoldsz.strefa.pl/queryplan-1.txt
and second:
(Executed successfully in 2,098.677 s.)
http://witoldsz.strefa.pl/queryplan-2.txt
Thank you for sharing the two query plans. They are quite interesting.
Witold Szczerba wrote:
2010/3/19 Bryan Pendleton bpendleton.de...@gmail.com:
SELECT count(*)
FROM contract co
LEFT JOIN ContractSubject insured ON insured.contract_id=co.id AND
insured.id=co.insured_id
In this query, how does the result (the returned count) change when you
change LEFT JOIN
What I do is I iterate over the db folder and delete all contents, as
returned by the java.io API.
I delete the db in the tearDown, see it deleted, but then in setup I'm
told that it already exists.
Do you delete the db folder itself? Or just its contents? Try making sure
that the entire db
SELECT count(*)
FROM contract co
LEFT JOIN ContractSubject insured ON insured.contract_id=co.id AND
insured.id=co.insured_id
In this query, how does the result (the returned count) change when you
change LEFT JOIN to JOIN?
It sounds like you have a large number of contract records which have
We are connecting to embedded derby and trying to execute this test. It
intially used to pass, but after adding a column LAST_UPLOAD_TIME the
following is the error. Please help.
When you add the column to your program, you also need to add the column
to your table. Something along the lines
For testing, how can I make sure the tearDown completely deletes the
db, and setUp creates a completely new copy, without using in-memory
db?
We do this in the Derby regression test suite.
Have a look at
org.apache.derbyTesting.functionTests.junit.CleanDatabaseTestSetup.java
thanks,
bryan
TRANSLATION is a reserved word in Derby but I could not find it in docs.
Could someone point me to a resource documenting it's use.
I don't see any other references to it in sqlgrammar.jj other than in the
keyword list itself.
So perhaps it doesn't need to be a reserved word.
I can't recall
Does anybody have experience of running statistics or compression which
they can share?
In my production Derby app, which has run 24x7 for over 4 years, I have
a few tables which I need to compress, approximately every 6 months.
I have not found it necessary to update statistics on my tables.
Blair Zajac wrote:
In trying to write a clearer query I added ()'s around the sub-queries
that are being UNIONed together, but Derby doesn't accept it.
I think this is DERBY-2374: https://issues.apache.org/jira/browse/DERBY-2374
This problem has been studied in some detail but we don't
I'm sometimes getting deadlocks in Log2File where all my worker threads
are getting blocked, but I can't figure out which monitor they are
blocked on.
Thanks for sending the thread dump, it was very interesting.
I agree with you, it's not clear what is blocking these threads,
at least from
I'm Denis Weerasiri, an undergraduate from University of Moratuwa, Sri
Lanka. Still I don't have an concrete idea, I'm hoping to come up with
an improvement to derby tooling and utilities as my GSoC project in this
year. Last year, I successfully completed my GSoC project, BPEL debugger
for
I'm getting a NPE with Derby 10.5.3.0. Is there a known workaround or
can I post this as a bug at JIRA?
Hi Murat,
I see the same problem with the current Derby trunk, so this seems
like a new bug to me. If you could post it as a bug at JIRA that would
be very much appreciated.
Please include
ResultSet rs = con.createStatement().executeQuery(
select * from TABLE1);
rs.next();
InputStream is = rs.getBinaryStream(1);
long length = rs.getBlob(1).length();
rs.close();
select firstname || case when length(middlename) = 0 then '' else ' '
|| middlename end || ' ' || lastname as name from studentmaster
where name like 'abc d%'
In the above statement, I have tried to give the name 'name' to the
combined filed of three columns.
You need an 'end' for the
Dinesh Bajaj wrote:
preparedStatement.setBinaryStream(5, inputStream, file.length());
Message = Java exception: 'Input stream did not have exact amount of
data as the requested length.:
Can you show more of your actual code? It sounds like 'inputStream'
is not returning the data
The goal is to refresh a JSP web page on a web browser when the Derby DB on
the server is changed.
I agree with Ronald Rudy's observation that the web browser itself will need
to initiate the polling request.
Meanwhile, on the server side, Derby supports triggers, which you can use
to track
I'm pretty sure that in the past I've done
jdbc:derby://192.168.0.110:1527/helpdesk with user and password
at gotten it to work. ( also with a windows server environment )
But right now nothing works ...
(the localhost.1527 does work ...
Check the arguments that you are passing to
Hi Hussein, I am glad you are enjoying Derby!
it was not a problem; since I started to use derby the *.jar files are not
found correctly if the path contains a space, e.g D:\WSpace\Program
Files\Apache\derby*. I then set the path in quotation marks (as shown);
it works for some tools and not
But all of a sudden the table disappeared from the list, i decided then
to close everything and try to connect again, where i get the following
message:
Unable to connect. Cannot establish a connection to derbydb url using
One possibility is that when you closed your previous application, you
1) how can actions of those connecting to the NetworkServerControl via
JDBC be controled (for instance, limited to read only)?
Derby has a variety of access control facilities. Here's a good place to
start learning about them:
http://db.apache.org/derby/docs/10.5/devguide/cdevcsecuree.html
But
DerbyServer thread seems to still be running, yet the server is
unresponsive.
In addition to your own DerbyServer thread, which I don't think
actually *needs* to still be running, there should be a separate
thread which is started by the Derby network server code itself,
which has the job of
But that's assuming a perfect layout for the database. I am
wondering, how much overhead should I account for?
My feeling is: try it and see. It shouldn't take longer than a
few hours to construct a test program which manufactures semi-random
data along the profile that you anticipate. Then
Thanks! Can the compress routines be called programatically?
Yes; there's an example on this page:
http://db.apache.org/derby/docs/10.5/ref/rrefaltertablecompress.html
thanks,
bryan
I thought if there was an abnormal termination then the db.lck is left
in place and an attempt to boot the db will fail.
The first part is true, but the second should not be. It is OK for the db.lck
file to be left around after an abnormal termination. On the next boot,
the Derby recovery
Hi David,
At what point does derby decide on the pagesize when it is creating a table?
During the bind processing (compilation) of the CREATE TABLE statement itself.
I have a table with several varchar(4000) fields in it. Though they are
varchar, does derby calculate row size based on the
David Parker wrote:
slowdowns that we have traced to this insert - a single insert taking several
seconds
That feels more like a locking issue than an I/O issue, to me.
Perhaps you have some sort of rarely-run query which, when it runs,
scans and processes the entire table, thus locking the
Could you pls help me in explaining the steps how to create derby
service and run successfully?
C:\Softwares\apache-tomcat-5.5.28\apache-tomcat-5.5.28\bin\tomcat5.exe
//IS//DerbyServer1 --DisplayName=DerbyServer1 --StartMode=jvm
--StopMode=exe
The specific exception I'm getting is:
org.apache.derby.client.am.SqlException: A lock could not be obtained within
the time requested
Derby can be configured to provide a lot of additional
information which can help you understand why you are
getting lock timeouts and deadlocks in your
I've tried surrounding the name XML in double quotes (XML) but that
doesn't work.
It should work. I've used quoting in Derby in similar circumstances quite
successfully. Can you post more details about the exact statement
you issued and the exact error you received?
Note that if you enclose
I would like to backup derby databes. But I get this error:
*The local depo is empty. Cannot create archive.
That's not a Derby message. It must be coming from somewhere
in the backup tools and scripts that you have written yourself.
Perhaps you can search your source tree, and see where that
ive downloaded derby but cant seem to get eclipse to recognize it.
The Derby plugins for Eclipse are in a separate download, they are
not part of the basic Derby download.
Go back to
http://db.apache.org/derby/releases/release-10.5.3.0.cgi#Distributions
and look at the end of that section,
using prepared statements executed in batches, and this gives me
between 10 and 20 row inserts per millisecond on average. I have
Wow! You're already going very fast, and you've already put a lot
of good effort into this, so I congratulate you on how far you've
gone already.
A couple of
It seems that deleting a table takes a VERY long time.
As an alternative, you can try DROP TABLE and then CREATE TABLE,
and see if that is faster.
thanks,
bryan
However, memory consumption is getting out of hand now that we're reaching
hundreds of databases.
...
At any one time there are only a few databases active
Is it possible that you aren't fully shutting each database down when you
are through with it?
thanks,
bryan
is there an easy way to execute multiple queries from a textfile using Java?
You might find the ij.runScript method helpful:
when trying to call the next method on a result set generated by a
select statement I get the exception:
java.sql.SQLException: ResultSet not open. Verify that autocommit is OFF.
By default, a connection is in auto-commit mode. To set autocommit OFF, add
java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ041,
SQLERRMC: Failed to create database 'C:\myapp\db', see the next
exception for details.::SQLSTATE: XBM0JDirectory
C:\db-derby-10.5.1.1-bin\bin\C:\myapp\db already exists.
I think it would be good if you could file an issue
Could anyone please confirm whether derby supports windows 7 and which
versions are?
Derby cares much more about which version of *Java* you are running,
than it does about which operating system you are running.
Derby runs great using Sun's JDK 1.6 on Windows 7.
The latest version of Derby
first runs some sql through the sql task, then runs JUnit to run my
test class?
If you take out the sql task invocation, does your script run correctly?
If so, then I'd think this might be a bug in the SQL task, that it
isn't closing down the connection properly at the completion of its work.
when I start the server from Ant, it blocks the execution, even if I did
fork=true in the java execution.
You can use the parallel task to solve this problem.
thanks,
bryan
When I try to run WwdEmbedded.java there is an error that looks like this:
---
C:\Documents and Settings\Zoran\Desktop\DERBYTUTORjava WwdEmbedded
Exception in thread main java.lang.NoClassDefFoundError: WwdEmbedded
I suspect
I am following *Getting Started With Java DB* instructions.
Problem occures when I try to follow instructions for *Run a JDBC
program using the embedded driver*.
Hi, Sorry about this. We just fixed these docs in the trunk, so the
docs will be better in the next release.
When I try to compile
Client Code:
Properties props = System.getProperties();
I don't think you need to pass all the system properties
to DriverManager.getConnection(). Try changing the above line to:
Properties props = new java.util.Properties();
Does that help?
thanks,
bryan
not seem to be able to find the embedded driver. I cannot find a library
called Embedded Driver. Can anyone see what I am doing wrong? I
EmbeddedDriver is not a library, it is a class.
Can you post your code? That would make it easier to see what you are doing
wrong.
Can you compare your
I will attempt running the command via ODBC directly, with the FETCH syntax,
and produce a heap histogram (is there anything in particular you are looking
for or a specific tool output -- I generally use jprofiler).
This sounds like a great next step, please let us know what you find.
As
kashyup wrote:
Hello all, after going through much docs i think i have lost answers to much
basic questions. I would appreciate any reply...
These are quite interesting questions. It seems that you have done a lot
of research and are seeing some puzzling results.
One of the first things to
For example, this morning I started my app and did few 'app stuff', the
queries took much longer. I closed my app/JVM, started again and did the
exact same 'app stuff', and the queries were much faster.
Is it possible that this has nothing to do with Derby, but is instead
some other behavior on
-- This is the real query (with subquery)
SELECT em.end_item_meter_id
FROM end_item_meter em
WHERE em.end_Item_meter_id IN
(
SELECT
mr.end_item_meter_id
FROM
Meter_Reading mr
Thomas Hill wrote:
I finally managed to get this running.
Great!
I took your notes and edited them into a page on the Derby wiki
http://wiki.apache.org/db-derby/NetworkServerServletInterface
so that hopefully it will be useful to others in the future.
One question:
3) Restarting Tomcat
10) when typing http://localhost:8180/derby/derbynet into the browser instead
I am getting HTTP 500 'Wrapper can not find servlet
org.apache.drda.NetServlet or a class it depends on'
Hi Thomas,
I'm not a big user of derby.war so I'm not sure what's wrong here, but
the first thing to know is
Is there some stupid newbie mistake that can cause your Derby databases to
disappear?
A Derby database is just a filesystem directory, so if you accidentally
remove that directory, you have just removed your database.
Another common source of confusion is to use a relative filesystem name
for
Do people agree that this appears to be a bug with the query planner, as the
selection of the most appropriate index should not be influenced by static
conditions such as 1=1 or 21?
I don't know of any reason why the 1=1 versus 21 should have affected the
query plan chosen.
If you can provide
java.lang.StackOverflowError
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at org.apache.derby.iapi.services.io.LimitInputStream.read(Unknown
...
That's a very interesting stack trace, thanks for
Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error:
SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC:
java.lang.StackOverflowErrorXJ001.U
at org.apache.derby.client.am.ResultSet.completeSqlca(Unknown Source)
Is there a more detailed exception trace in your derby.log file?
I'd
201 - 300 of 575 matches
Mail list logo