John I. Moore, Jr. | 17 Jan 16:23 2014
Picon
Picon

Network Server Access Permissions and Java 1.7.0_51

Java version 1.7.0_51 (latest version) causes the following error when trying to start the network server.  I can see from the issue tracker that there is a fix to be added that should correct this problem in the next release, but is there an easy workaround that exists now?  Details would be appreciated.

 

_________________________________________

 

John I. Moore, Jr.

 

C:\Java\db-derby-10.10.1.1-bin\bin>startNetworkServer.bat

Thu Jan 16 16:34:04 EST 2014 : Security manager installed using the Basic server security policy.

Thu Jan 16 16:34:04 EST 2014 : access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")

java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")

        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)

        at java.security.AccessController.checkPermission(AccessController.java:559)

        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)

        at java.lang.SecurityManager.checkListen(SecurityManager.java:1134)

        at java.net.ServerSocket.bind(ServerSocket.java:375)

        at java.net.ServerSocket.<init>(ServerSocket.java:237)

        at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)

        at org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown Source)

        at org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown Source)

        at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)

        at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)

        at java.security.AccessController.doPrivileged(Native Method)

        at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)

        at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source)

        at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)

 

AirDT | 16 Jan 15:41 2014
Picon

Derby in production environment

Hello, 

I want to use Derby in a production environment and I read the following
sentence: 
"The Derby database Has No Associated security controls, and no
optimizations-have-been performed. Reasons For thesis, do not use Derby in a
Production environment." 
in doc 
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fah35004_.htm

Is Derby currently being used successfully in production environments?

Any information would be appreciated. Thanks in advance.

AirDT

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

Bob M | 11 Jan 20:20 2014
Picon

Exporting table records

Hi

I have a derby database with one table which I access using Netbeans

What is an easist way for me to export the contents of the table ?

Bob M

--
View this message in context: http://apache-database.10148.n7.nabble.com/Exporting-table-records-tp136465.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.

Han Xin | 10 Jan 19:59 2014
Picon

Can I run derby for a long time?

Can I run derby for a long time with many inserts, deletes and updates? Are the memories, disk spaces recovered after deletion/updating?

Any information would be appreciated. Thanks in advance.
Melissa Mifsud | 10 Jan 05:40 2014
Picon

Setting derby.storage.pageSize

Version: 10.10.1.1 (Embedded)

I have been trying to set the derby.storage.pageSize on an index according to http://db.apache.org/derby/docs/10.10/ref/rrefproper40688.html in the hope that increasing the pageSize will help with a large insert/update.

It seems the value doesn't seem to be changing. The relevant part of my script is:

call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','16384'); 
-- CREATE TABLE DataSource...
CREATE INDEX dataSource_path_idx ON DataSource(connectorId, path);
select p, syscs_util.syscs_get_database_property(p) from (values 'derby.storage.pageCacheSize', 'derby.storage.pageSize') props(p); 
call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
select p, syscs_util.syscs_get_database_property(p) from (values 'derby.storage.pageCacheSize', 'derby.storage.pageSize') props(p); 


Both selects give the same output:
P                                         |2                                                                                                                               
-----------------------------------------------------------------------------------
derby.storage.pageCacheSize               |4000                                                                                               
derby.storage.pageSize                    |NULL    


So I have (earlier in the script) changed the pageCacheSize property using SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY but the pageSize does not change.
Running select pagesize from table (syscs_diag.space_table('APP', 'DataSource')) s; returns no rows.
  1. Is there a way to check what the pageSize of an index is?
  2. Is there some other way I should be setting the pageSize property?

Thanks,
Melissa



Paul Linehan | 9 Jan 07:33 2014
Picon
Picon

Biggest Apache Derby database(s).

Hi all,

I would like to know (with references/URLs preferably) what are the
kinds of sizes that large Derby installs stretch to? Would it go to 1TB?
More? Less?

Thanks in advance for any info, pointers and esp. references and URLs.

Rgs,

Paul...

--

-- 

linehanp@...

Mob: 00 353 86 864 5772

Tim Dudgeon | 6 Jan 13:47 2014

varargs functions: primitive or Object type?

I'm trying to write a function that performs aggregation and I'm not 
clear on how to handle the varargs part.
Lets assume I was wanting to write a function that does averaging, and 
handles null values correctly.
I'm defining my function like this:

CREATE FUNCTION MYAVG
( VALS DOUBLE ... )
RETURNS DOUBLE
PARAMETER STYLE DERBY
NO SQL LANGUAGE JAVA
EXTERNAL NAME 'myorg.misc.derby.functions.MyFunctions.myAverage;

What does the signature of the Java method need to be?
I've tried:

static Double myAverage(Double[] vals) { }
static Double myAverage(Double... vals) { }

Both of these fail with:
java.sql.SQLSyntaxErrorException: No method was found that matched the 
method call myorg.misc.derby.functions.MyFunctions.myAverage(double...), 
tried all combinations of object and primitive types and any possible 
type conversion for any  parameters the method call may have

Seems like its wanting
static Double myAverage(double... vals) { }
but if that's the case how are nulls handled?

Thanks
Tim

Lou DeGenaro | 5 Jan 16:12 2014
Picon

slow query? (from a practical newbie)

My table: Job

(
 primaryKey int primary key generated always as identity,
 id int not null,
 startDate bigint not null,
 endDate bigint not null,
 duration int not null,
 userId varchar( 64 ) not null,
 submitter varchar( 64 ) not null,
 schedulingClass varchar( 64 ) not null,
 debugPortDriver int not null,
 debugPortProcess int not null,
 state varchar( 64 ) not null,
 stateIndex int not null,
 completionType varchar( 64 ) not null,
 completionRationale varchar( 1024 ) not null,
 services int not null,
 processes int not null,
 initFails int not null,
 runFails int not null,
 pgin int not null,
 swapGbMax double not null,
 memorySizeGb int not null,
 workItemsTotal int not null,
 workItemsDone int not null,
 workItemsError int not null,
 workItemsRetry int not null,
 workItemsPreempt int not null,
 workItemsStatMax int not null,
 workItemsStatMin int not null,
 workItemsStatMean int not null,
 workItemsStatStdDev int not null,
 description varchar( 4096 ) not null,
 schedulingSharesMax int not null,
 logDirectory varchar( 4096 ) not null,
 jsonServiceDependencies clob not null,
 jsonJobDeployment clob not null,
 projection bigint not null,
 swapGbCurrent double not null,
 workItemsDispatch int not null,
 constraint uniqueColumns unique ( id )
)

=====

My indexes:

CREATE INDEX id_desc ON Job (id desc)
CREATE INDEX stateIndex_asc_id_desc ON Job (stateIndex asc, id desc)

=====

Query #1 - fast! meaning sub-second using prepared statement

     select * from Job order by stateIndex asc, id desc offset ? rows fetch next ? rows only

=====

Query #2 - slow :-( meaning on the order of 30 seconds on a table with 55,000 records

     select * from Job where id < ? order by stateIndex asc, id desc offset ? rows fetch next ? rows only

=====

Ostensibly the where clause really slow does the query.  How come and how do I remedy?

Thanx!

Lou.

Tim Dudgeon | 3 Jan 13:49 2014

Unnecessary increment of sequence

I'm trying to use a sequence to generate a value where one is not 
supplied, but I'm not able to only increment the sequence when its 
needed. This is actually going on in a trigger, but to simplify matters 
here is an example that illustrates the problem:

VALUES SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE('APP', 'SEQ_CPD_CODE');
VALUES COALESCE(99, NEXT VALUE FOR seq_cpd_code);
VALUES SYSCS_UTIL.SYSCS_PEEK_AT_SEQUENCE('APP', 'SEQ_CPD_CODE');

In the coalesce function the first argument is always non null, so the 
second argument should never be needed, but you will see that the 
sequence is incremented anyway.
Are there any alternative approaches that can avoid this?
I was thinking of trying in a CASE statement instead, but sequences 
can't be used there :-(

Thanks
Tim

Martijn Blankestijn | 2 Jan 18:05 2014
Picon

JDK 8 and setObject

Hi,

I am using DERBY: "10.10.1.2", packaged with Java 8 JDK ("java.runtime.version=1.8.0-ea-b120").

I created a table in-memory: create table Persoon (id int not null GENERATED ALWAYS AS IDENTITY , datum date not null, tijd time not null, tijdstip timestamp not null)

When I use the following code:

    try (PreparedStatement preparedStatement = connection.prepareStatement("insert into Persoon  (datum, tijd, tijdstip) values (?,?,?)")) {
      preparedStatement.setObject(1, LocalDate.of(2014, 3, 20), JDBCType.DATE);

I get the following exception:

java.sql.SQLDataException: An attempt was made to get a data value of type 'DATE' from a data value of type 'java.time.LocalDate'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.dataTypeConversion(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.setObject(Unknown Source)
at nl.ordina.jdk8.TimePersistenceTest.insertParameterSetObject(TimePersistenceTest.java:48)

If I skip the JDBCType.Date, I get the same error.

In the "JDBC Maintenance Release 4.2" proposed changes the following is written

"21 Add the following mapping to table B-4, Mapping from Java Objects to JDBC Types
• Map the Java Object Type javax.time.LocalDate to the JDBC Type DATE

22 Add the following mapping to table B-5, Mapping, conversions Performed by setObject and setNull between
Java Object Types
• Allow the conversion of javax.time.LocalDate to CHAR, VARCHAR, LONGVARCHAR, and DATE"

Am I missing something?

Regards,

Martijn Blankestijn
SolGT | 31 Dec 12:01 2013
Picon

Derby running on local computer ans Data Base located on server

Hi

In derbydev.pdf ( 10.10.1.1) page 26, I read  :
**********************************************************
Conventions for specifying the database path
...
You can specify only databases that are local to the machine on which the JVM
is running. ...
**********************************************************
I want to use Derby (embedded mode) in my application on a networked computer and place the databases on the server.
Is it possible ?

Thanks

AirDT

Gmane