From derby-user-return-14496-apmail-db-derby-user-archive=db.apache.org@db.apache.org Mon Jul 23 13:34:55 2012 Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 064B0D134 for ; Mon, 23 Jul 2012 13:34:55 +0000 (UTC) Received: (qmail 72556 invoked by uid 500); 23 Jul 2012 13:34:54 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 72417 invoked by uid 500); 23 Jul 2012 13:34:50 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 72388 invoked by uid 99); 23 Jul 2012 13:34:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 13:34:49 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [82.195.46.59] (HELO smtp01.equens.com) (82.195.46.59) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jul 2012 13:34:43 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CD68D7.D906EFF0" Subject: AW: schema-questions Date: Mon, 23 Jul 2012 15:34:12 +0200 Message-ID: <944A1108FF717B43A3F9AA883583DDB202330FD6@EVS01.intern.interpay.nl> In-Reply-To: <944A1108FF717B43A3F9AA883583DDB202330F7E@EVS01.intern.interpay.nl> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: schema-questions Thread-Index: Ac1lzYkfm6DR8+raTMyy+aY9RMCb+wAyh+bgAI+dKtA= References: <944A1108FF717B43A3F9AA883583DDB202330E8A@EVS01.intern.interpay.nl> <1342541288.30268.4346.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330E92@EVS01.intern.interpay.nl> <1342557348.30268.4451.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330EC7@EVS01.intern.interpay.nl> <1342626465.30268.4587.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330F41@EVS01.intern.interpay.nl> <1342716252.30268.4680.camel@dellberry> <944A1108FF717B43A3F9AA883583DDB202330F7E@EVS01.intern.interpay.nl> From: To: X-OriginalArrivalTime: 23 Jul 2012 13:34:13.0154 (UTC) FILETIME=[D9003820:01CD68D7] This is a multi-part message in MIME format. ------_=_NextPart_001_01CD68D7.D906EFF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi to all, I tried to find something on the internet belongig to my question: what = is to do for connecting with a user to a different schema than the = username or APP. Actually I found 2 hints 1.=09 use SET CURRENT SCHEMA 2.=09 Make your own custom authentication Source of above hints is this site: = http://www.oreillynet.com/onjava/blog/2006/07/on_derby.html = that is = from 2006 =20 Well choice 1. is not really usable when a datasource is to be defined, = is it?=20 Choice 2.seems to be a bit overheaded. Is it so exotic to connect with a = user using a different schema so nobody know how to or an custom = implementation needs to be produced on ones own? Or is there a way in the newest release of Derby?=20 =20 Thanks for hints in advance =20 Malte =20 ________________________________ Von: Malte.Kempff@de.equens.com [mailto:Malte.Kempff@de.equens.com]=20 Gesendet: Freitag, 20. Juli 2012 18:56 An: derby-user@db.apache.org Betreff: schema-questions Somehow I ask now myself, how I can connect to another schema than the = username. Currently I have a user tech that is suppose to connect to the schema = user_stuff via DataSource I tried now this but obviously ist not correct becides the password is = still ignored also the schema seems not to be declared like this Context.xml for defining the DataSource: Does anybody know what is to be used to be on the right schema = 'USER_STUFF' ? -----Urspr=FCngliche Nachricht----- Von: Tim Watts [mailto:tim@cliftonfarm.org] Gesendet: Donnerstag, 19. Juli 2012 18:44 An: Derby Discussion Betreff: Re: AW: AW: AW: schema-questions On Thu, 2012-07-19 at 17:23 +0200, Malte.Kempff@de.equens.com wrote: > Do I get it right, that the threads defined in Network server of derby > should correspond with amount of connections in defined data source > for derby in the Application Server, where it is running in? Is there > any best practice? > I suppose so but not necessarily. Unless you have an uncontrollable = need to complicate life I would leave it at the default of 0 ("elastic = mode"). This way Derby will spawn a thread to service each connection = as it's made. A non-zero value will make that the upper limit for = worker threads. Not that Derby will refuse further connections once the = max is reached; only that the new connections will have to wait for CPU = time until one of the other threads is done or it's timeSlice has = expired. (But, of course, adding more threads doesn't magically create = more CPU capacity. So I imagine a non-zero value would be balanced = against the number of available cores/CPUs?) I'm writing from a = theoretical perspective here as I haven't actually messed with any of = this. My impression is that your goal is to explore web app development using = Derby. In general, focusing on performance tuning in the absence of an = actual performance issue is not going to be very productive. > Malte > > > -----Urspr=FCngliche Nachricht----- > Von: Tim Watts [mailto:tim@cliftonfarm.org] > Gesendet: Mittwoch, 18. Juli 2012 17:48 > An: Derby Discussion > Betreff: Re: AW: AW: schema-questions > > Hi Malte, > > On Wed, 2012-07-18 at 13:44 +0200, Malte.Kempff@de.equens.com wrote: > > Hi Tim > > My JAVA_OPS look like that, when I use set command: > > JAVA_OPTS=3D-Dderby.system.home=3Dc:\derby-dbs > > That looks reasonable. > > > > > I suppose that the JAVA_OPTS are recognized by derby in my > > particular case. Otherweise I would not understand why derby > > produces and writes and reads from the given directory. > > It is a bit of unexplainable to me, since today it works with > > following ij call java %JAVA_OPTS% -Dij.protocol=3Djebc:derby: -jar > > %DERBY_HOME %/lib/derbyrun.jar ij > > ij> connect > > = 'jdbc:derby://localhost:1527/testdb;create=3Dtrue;user=3Dtralla;password > > =3Dd > > uddeldi'; > > Here I get the expected error now: > > FEHLER 08004: Die Verbindung konnte nicht authentifiziert werden. > > Ursache: Die Benutzer-ID oder das Kennwort ist ung=B3ltig. > > > > > > Yesterday it did not work neither via ij nor within tomcat. Always > > it did not matter whether the right password or user was set or not. > > It would be very difficult to figure out exactly what actually = happened between yesterday and today from a few sketchy details. It = probably doesn't matter much at this point. > > > > > Using tomcat I still get that ignoring of derby.properties, > > Did you try invoking test.jsp from my last post? That would tell you = if the running instance of Tomcat had a JAVA_OPTS and derby.system.home = passed through to it. > > > at least the password I am using seems not to matter at all Here my > > entry in context.xml for tomcat similar to the recommanded one I > > found in http://www.zetcode.com/db/apachederbytutorial/tomcat/ > > > > > auth=3D"Container" > > type=3D"javax.sql.DataSource" > > username=3D"tech" > > password=3D"schnaddel" > > driverClassName=3D"org.apache.derby.jdbc.ClientDriver" > > url=3D"jdbc:derby://localhost:1527/testdb" > > maxActive=3D"10" > > maxIdle=3D"4"/> > > > > > > > > The right password is supposed to be something else , but it works > > :-D > > (?!) > > > > By the way (sorry for asking such a question of beginners :-)): > > Using the web-app of derby (Derby Network Server) there is the > > option to change max amount of threads and thread time slices. > > What does that mean exactly? Could that interfere with the > > definition of DataSource within context.xml, or is that something > > totally different? > > See > http://db.apache.org/derby/docs/10.8/adminguide/tadminconfiguringthene > tworkserver.html > > > > > > Lastly, let me point out that there is absolutely NO requirement to = run the Derby war in order to use Derby from a web application. You = could just as easily run the Derby Network Server in a separate process = or use an embedded Derby engine. Just wanted to point that out so you = and others aware of the possibilities. > > > > > > > > > -----Urspr=FCngliche Nachricht----- > > Von: Tim Watts [mailto:tim@cliftonfarm.org] > > Gesendet: Dienstag, 17. Juli 2012 22:36 > > An: Derby Discussion > > Betreff: Re: AW: schema-questions > > > > On Tue, 2012-07-17 at 18:13 +0200, Malte.Kempff@de.equens.com wrote: > > > I start tomcat (version 6) with ist startup batch file only > > > > > OK. What displays when you type echo %JAVA_OPTS% at the command > > prompt? > > > > To verify whether it's being passed through to Tomcat try saving the > > following to webapps/ROOT/test.jsp then pointing your browser to > > http://localhost:8080/test.jsp . > > > > test.jsp: > > --------- > > > > > > derby.system.home=3D<%=3D System.getProperty("derby.system.home") = %>
> > JAVA_OPTS=3D<%=3D System.getenv("JAVA_OPTS") %>
> > > > I have verified on my system that derby.properties is recognized > > when setting derby.system.home via JAVA_OPTS. (Derby 10.8.1.2) > > > > > > > -----Urspr=FCngliche Nachricht----- > > > Von: Tim Watts [mailto:tim@cliftonfarm.org] > > > Gesendet: Dienstag, 17. Juli 2012 18:08 > > > An: Derby Discussion > > > Betreff: Re: schema-questions > > > > > > On Tue, 2012-07-17 at 16:44 +0200, Malte.Kempff@de.equens.com = wrote: > > > > Another thing I am wondreing is, that it seems not to matter > > > > using a user or not using following derby.properties, though: > > > > derby.stream.error.logSeverityLevel=3D0 > > > > derby.database.fullAccessUsers=3Dtech > > > > derby.database.defaultConnectionMode=3DreadOnlyAccess > > > > derby.connection.requireAuthentication=3Dtrue > > > > derby.user.tech=3Dlala_dongs > > > > derby.user.rou=3Dgaga_bings > > > >=20 > > > > derby.authentication.provider=3Dbuiltin > > > >=20 > > > >=20 > > > > derby seems not to use my derby.proerties. I have put them to > > > > the directory, which is given in the derby.system.home > > > > Java-system-property. > > > > It is told to put this system-property into the environment > > > > variable JAVA_OPTS, so tomcat would use it for starting up. > > > > I am using Windows-XP so I defined ths environment-variable in > > > > the dialog as user defined variable. > > > > What am I missing, since derby.properties seem not to work may > > > > be not even been read. > > > >=20 > > > Are you running Tomcat as a service? If so then see this: > > > > > > =20 > > > http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html > > > > > > (adjust according to the tomcat version you're using). > > > > > > > Thanks for hints in advance > > > >=20 > > > > Malte > > > > > > > > > > ------_=_NextPart_001_01CD68D7.D906EFF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi to=20 all,
I tried to find = something on=20 the internet belongig to my question: what is to do for connecting with = a user=20 to a different schema than the username or = APP.
Actually I found = 2=20 hints
  1. use SET CURRENT = SCHEMA
  2. Make your own = custom=20 authentication
Source of above = hints is this=20 site: http://www.oreillynet.com/onjava/blog/2006/07/on_derby.html that is from 2006
 
Well choice 1. is = not really=20 usable when a datasource is to be defined, is it? =
Choice 2.seems to = be a bit=20 overheaded. Is it so exotic to connect with a user using a different = schema so=20 nobody know how to or an custom implementation needs to be produced on = ones=20 own?
Or is there a way = in the newest=20 release of Derby?
 
Thanks for hints = in=20 advance
 
Malte
 

Von: Malte.Kempff@de.equens.com=20 [mailto:Malte.Kempff@de.equens.com]
Gesendet: Freitag, 20. = Juli 2012=20 18:56
An: derby-user@db.apache.org
Betreff:=20 schema-questions


Somehow I ask now myself, how I can connect to = another=20 schema than the username.
Currently I have a user tech that is = suppose to=20 connect to the schema user_stuff via DataSource
I tried now this but=20 obviously ist not correct becides the password is still ignored also the = schema=20 seems not to be declared like this
Context.xml for defining the=20 DataSource:

<?xml version=3D"1.0"=20 encoding=3D"UTF-8"?>
<Context>
    = <Resource=20 name=3D"jdbc/testdb"
        &= nbsp;    =20 auth=3D"Container"
        &nb= sp;    =20 type=3D"javax.sql.DataSource"
      &nbs= p;      =20 username=3D"tech"
        &nbs= p;    =20 password=3D"schnaddel"
        = ;     =20
schema=3D"USER_STUFF"
   =           =20 driverClassName=3D"org.apache.derby.jdbc.ClientDriver"
  &nb= sp;          =20 url=3D"jdbc:derby://localhost:1527/testdb"
    &nb= sp;        =20 maxActive=3D"10"
         = ;    =20 maxIdle=3D"4"/>
</Context>

Does anybody know what is to be used to be on the = right=20 schema 'USER_STUFF' ?



-----Urspr=FCngliche=20 Nachricht-----
Von: Tim Watts [mailto:tim@cliftonfarm.org]
Ge= sendet:=20 Donnerstag, 19. Juli 2012 18:44
An: Derby Discussion
Betreff: Re: = AW: AW:=20 AW: schema-questions

On Thu, 2012-07-19 at 17:23 +0200,=20 Malte.Kempff@de.equens.com wrote:
> Do I get it right, that the = threads=20 defined in Network server of derby
> should correspond with amount = of=20 connections in defined data source
> for derby in the Application = Server,=20 where it is running in? Is there
> any best practice?
>
I = suppose=20 so but not necessarily.  Unless you have an uncontrollable need to=20 complicate life I would leave it at the default of 0 ("elastic = mode"). =20 This way Derby will spawn a thread to service each connection as it's=20 made.  A non-zero value will make that the upper limit for worker=20 threads.  Not that Derby will refuse further connections once the = max is=20 reached; only that the new connections will have to wait for CPU time = until one=20 of the other threads is done or it's timeSlice has expired. (But, of = course,=20 adding more threads doesn't magically create more CPU capacity.  So = I=20 imagine a non-zero value would be balanced against the number of = available=20 cores/CPUs?)  I'm writing from a theoretical perspective here as I = haven't=20 actually messed with any of this.

My impression is that your goal = is to=20 explore web app development using Derby.  In general, focusing on=20 performance tuning in the absence of an actual performance issue is not = going to=20 be very productive.


> Malte
>
>
>=20 -----Urspr=FCngliche Nachricht-----
> Von: Tim Watts [mailto:tim@cliftonfarm.org]
&g= t;=20 Gesendet: Mittwoch, 18. Juli 2012 17:48
> An: Derby = Discussion
>=20 Betreff: Re: AW: AW: schema-questions
>
> Hi = Malte,
>
>=20 On Wed, 2012-07-18 at 13:44 +0200, Malte.Kempff@de.equens.com = wrote:
>=20 > Hi Tim
> > My JAVA_OPS look like that, when I use set=20 command:
> > = JAVA_OPTS=3D-Dderby.system.home=3Dc:\derby-dbs
>
>=20 That looks reasonable.
>
> >
> > I suppose that = the=20 JAVA_OPTS are recognized by derby in my
> > particular case. = Otherweise=20 I would not understand why derby
> > produces and writes and = reads from=20 the given directory.
> > It is a bit of unexplainable to me, = since=20 today it works with
> > following ij call java %JAVA_OPTS%=20 -Dij.protocol=3Djebc:derby: -jar
> > %DERBY_HOME = %/lib/derbyrun.jar=20 ij
> > ij> connect
> >=20 'jdbc:derby://localhost:1527/testdb;create=3Dtrue;user=3Dtralla;password<= BR>>=20 > =3Dd
> > uddeldi';
> > Here I get the expected = error=20 now:
> > FEHLER 08004: Die Verbindung konnte nicht = authentifiziert=20 werden.
> > Ursache: Die Benutzer-ID oder das Kennwort ist=20 ung=B3ltig.
> >
> >
> > Yesterday it did not = work=20 neither via ij nor within tomcat. Always
> > it did not matter = whether=20 the right password or user was set or not.
>
> It would be = very=20 difficult to figure out exactly what actually happened between yesterday = and=20 today from a few sketchy details.  It probably doesn't matter much = at this=20 point.
>
> >
> > Using tomcat I still get that = ignoring=20 of derby.properties,
>
> Did you try invoking test.jsp from = my last=20 post?  That would tell you if the running instance of Tomcat had a=20 JAVA_OPTS and derby.system.home passed through to it.
>
> = > at=20 least the password I am using seems not to matter at all Here my
> = >=20 entry in context.xml for tomcat similar to the recommanded one I
> = >=20 found in http://www= .zetcode.com/db/apachederbytutorial/tomcat/
>=20 > <?xml version=3D"1.0" encoding=3D"UTF-8"?> = <Context>
>=20 >     <Resource name=3D"jdbc/testdb"
>=20 >           &nb= sp;  =20 auth=3D"Container"
>=20 >           &nb= sp;  =20 type=3D"javax.sql.DataSource"
>=20 >           &nb= sp;  =20 username=3D"tech"
>=20 >           &nb= sp;  =20 password=3D"schnaddel"
>=20 >           &nb= sp;  =20 driverClassName=3D"org.apache.derby.jdbc.ClientDriver"
>=20 >           &nb= sp;  =20 url=3D"jdbc:derby://localhost:1527/testdb"
>=20 >           &nb= sp;  =20 maxActive=3D"10"
>=20 >           &nb= sp;  =20 maxIdle=3D"4"/>
> >
> > </Context>
> = >
>=20 > The right password is supposed to be something else , but it = works
>=20 > :-D
> > (?!)
> >
> > By the way (sorry = for=20 asking such a question of beginners :-)):
> > Using the web-app = of=20 derby (Derby Network Server) there is the
> > option to change = max=20 amount of threads and thread time slices.
> > What does that = mean=20 exactly? Could that interfere with the
> > definition of = DataSource=20 within context.xml, or is that something
> > totally=20 different?
>
> See
> http://db.apache.org/derby/docs/10.8/adminguide/tadminconfiguringt= hene
>=20 tworkserver.html
>
> >
> >
> Lastly, let = me point=20 out that there is absolutely NO requirement to run the Derby war in = order to use=20 Derby from a web application.  You could just as easily run the = Derby=20 Network Server in a separate process or use an embedded Derby = engine.  Just=20 wanted to point that out so you and others aware of the=20 possibilities.
>
> >
> >
> >
> = >=20 -----Urspr=FCngliche Nachricht-----
> > Von: Tim Watts [mailto:tim@cliftonfarm.org]
&g= t; >=20 Gesendet: Dienstag, 17. Juli 2012 22:36
> > An: Derby=20 Discussion
> > Betreff: Re: AW: schema-questions
> = >
>=20 > On Tue, 2012-07-17 at 18:13 +0200, Malte.Kempff@de.equens.com=20 wrote:
> > > I start tomcat (version 6) with ist startup = batch file=20 only
> > >
> > OK.  What displays when you = type =20 echo %JAVA_OPTS%  at the command
> > prompt?
> = >
>=20 > To verify whether it's being passed through to Tomcat try saving=20 the
> > following to webapps/ROOT/test.jsp then pointing your = browser=20 to
> > http://localhost:8080/test.jsp=20 .
> >
> > test.jsp:
> > ---------
> = >=20 <html>
> > <body>
> > = derby.system.home=3D<%=3D=20 System.getProperty("derby.system.home") %><br>
> >=20 JAVA_OPTS=3D<%=3D System.getenv("JAVA_OPTS") %><br> = </body>=20 </html>
> >
> > I have verified on my system = that=20 derby.properties is recognized
> > when setting = derby.system.home via=20 JAVA_OPTS. (Derby 10.8.1.2)
> >
> >
> > >=20 -----Urspr=FCngliche Nachricht-----
> > > Von: Tim Watts [mailto:tim@cliftonfarm.org]
&g= t; >=20 > Gesendet: Dienstag, 17. Juli 2012 18:08
> > > An: Derby = Discussion
> > > Betreff: Re: schema-questions
> >=20 >
> > > On Tue, 2012-07-17 at 16:44 +0200,=20 Malte.Kempff@de.equens.com wrote:
> > > > Another thing I = am=20 wondreing is, that it seems not to matter
> > > > using a = user or=20 not using following derby.properties, though:
> > > >=20 derby.stream.error.logSeverityLevel=3D0
> > > >=20 derby.database.fullAccessUsers=3Dtech
> > > >=20 derby.database.defaultConnectionMode=3DreadOnlyAccess
> > > = >=20 derby.connection.requireAuthentication=3Dtrue
> > > >=20 derby.user.tech=3Dlala_dongs
> > > >=20 derby.user.rou=3Dgaga_bings
> > > > 
> > = > >=20 derby.authentication.provider=3Dbuiltin
> > > = > 
> >=20 > > 
> > > > derby seems not to use my=20 derby.proerties. I have put them to
> > > > the = directory, which=20 is given in the derby.system.home
> > > >=20 Java-system-property.
> > > > It is told to put this=20 system-property into the environment
> > > > variable = JAVA_OPTS,=20 so tomcat would use it for starting up.
> > > > I am = using =20 Windows-XP so I defined ths environment-variable in
> > > = > the=20 dialog as user defined variable.
> > > > What am I = missing, since=20 derby.properties seem not to work may
> > > > be not even = been=20 read.
> > > > 
> > > Are you running = Tomcat as a=20 service?  If so then see this:
> > >
> >=20 >        
> > > = http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html=
>=20 > >
> > > (adjust according to the tomcat version = you're=20 using).
> > >
> > > > Thanks for hints in=20 advance
> > > > 
> > > > = Malte
> >=20 > >
> > >
>=20 >
>

------_=_NextPart_001_01CD68D7.D906EFF0--