Re: Variable for defining finder query?

2000-10-31 Thread Anders Bengtsson

  public static final String findByOwner_query="full: select "+
  "Page.key, Page.document, Page.title, Page.description, Page.author,
  "+
  "Page.stylesheet, Page.hits, Page.url, Page.content from Page "+
  "where Page_Children.document=$1 and Page_Children.key=$2 "+
  "order by Page.hits desc, Page.title desc";
  
  This variable is supposed to be in the bean implementation class.
 
 It's supposed to be in the Home interface (the natural location, since
 CMP EJB's have no finder method implementations in the actual bean
 implementation).

Thanks, now I got it working. No more orion-ejb-jar.xml!

But I don't really find the Home to be a natural location, since it means you have to 
expose that
variable with nasty internal workings to all the Home users. Ah well... :)

/Anders

A n d e r s  B e n g t s s o n[EMAIL PROTECTED]
http://www.lecando.com





Variable for defining finder query?

2000-10-30 Thread Anders Bengtsson

Hello,
I just found an example on orionsupport.com about an alternative to
orion-ejb-jar.xml for specifying finder queries:

public static final String findByOwner_query="full: select "+
"Page.key, Page.document, Page.title, Page.description, Page.author,
"+
"Page.stylesheet, Page.hits, Page.url, Page.content from Page "+
"where Page_Children.document=$1 and Page_Children.key=$2 "+
"order by Page.hits desc, Page.title desc";

This variable is supposed to be in the bean implementation class.

My question: Is this in any way documented anywhere, and is there anyone
who has actually tried it?
I haven't mananged to make it work anyway...

/Anders

A n d e r s  B e n g t s s o n[EMAIL PROTECTED]
http://www.lecando.com




Default isolation level

2000-10-24 Thread Anders Bengtsson

Hello,
does anyone know what the default isolation level for entity beans is?

In orion-ejb.jar.xml there is an attribute "isolation". According to the
documentation:
"The valid values are 'serializable', 'uncommitted', 'committed',
'repeatable_read'."
But it doesn't mention what the default value is.

Also, is there some way to set the isolation level for an entire EJB
application?

/Anders

A n d e r s  B e n g t s s o n[EMAIL PROTECTED]
http://www.lecando.com




Re: Different data-sources for different applications?

2000-08-17 Thread Anders Bengtsson

Karl Avedal wrote:
 
 Hello Anders,
 
 I see you've gotten good answers already, just wanted to point that if you want
 to use different defaults per application rather than per ejb, you can set the
 default-data-source attribute in the orion-application.xml file.

Yeah, there lots of good and quick feedback on this list. Thanks,
everyone!

/Anders

A n d e r s  B e n g t s s o n[EMAIL PROTECTED]
http://www.lecando.com




Minimum orion-ejb-jar.xml?

2000-08-17 Thread Anders Bengtsson

Hello,
does anyone know what fields in orion-ejb-jar.xml have to be defined for
it to work?
It seems to be a strange mix of user- and Orion-controlled fields, with
no documentation about which fields that are needed.
The attribute "wrapper" is of course filled out by Orion, but what about
the rest?

When my file consists of only
orion-ejb-jar/orion-ejb-jar
things work fine. But using empty "entity-deployment"-tags, with only
attributes defined, Orion gives the strange error:

java.lang.NullPointerException: length was zero
at com.evermind.xml.XMLConfig.ax(JAX)
at com.evermind.server.ServerComponent.aiu(JAX)
at com.evermind.server.ServerComponent.initDeployment(JAX)
at com.evermind.server.ejb.EJBPackageDeployment.aa2(JAX)
at com.evermind.server.ejb.EJBContainer.b0(JAX)
at com.evermind.server.Application.b0(JAX)
at com.evermind.server.Application.f8(JAX)
at com.evermind.server.ApplicationServer.o2(JAX)
at com.evermind.server.ApplicationServer.alv(JAX)
at com.evermind.server.ApplicationServer.f8(JAX)
at com.evermind.server.gi.run(JAX)
at java.lang.Thread.run(Thread.java:484)
at com.evermind.util.f.run(JAX)

Maybe this Orion trying to tell me that I need some more tag defined?..

/Anders

A n d e r s  B e n g t s s o n[EMAIL PROTECTED]
http://www.lecando.com




Re: Different data-sources for different applications?

2000-08-16 Thread Anders Bengtsson

Rick Bos wrote:
 
 You can modify this in orion-ejb-jar.xml.
 
 This file is found in orion/application-deployments/your-app/ejb
 
 You can copy this file to /ear/ejb/orion/orion-ejb-jar.xml and modify it
 there.
 
 ( where ear is your development directory and ejb is your Enterprise Java
 Bean directory).
 
 Hope this helps.

Thanks, that will solve most of my problems!

The remaining problem is that this would require a different .ear file
for each deployment. I'm trying to deploy the same application many
times on the same Orion, with different databases, to separate our
different customers.
Ideally it would be possible to change the data-source in some
deployment config outside of the .ear. But I guess I can simply solve
this by writing some small script to modify the .ear for each
deployment.

/Anders

  The basic problem seems to be that data-sources.xml is a global
  configuration, for all the applications in the server.
  Is there some way to come around this problem, like some way to select
  the datasource for each application?


A n d e r s  B e n g t s s o n[EMAIL PROTECTED]
http://www.lecando.com




Re: Faster deployment?

2000-08-04 Thread Anders Bengtsson


It spends a few seconds with "auto-unpacking" and "auto-deploying" ...
of course most of the time is spent doing table creations in the
in-memory HypersonicSQL database we're using for the tests.

Now that I think of it, there must be some way to pre-create those
tables even for a in-memory database. I'll try that approach... Thank
you for the great question! :-)

/Anders

Mike Clark wrote:
 
 What specifically is creating a drag on your deployment time?
 
 I use a Makefile which creates the .ear file, and once the .ear file is
 "touched", the server re-deploys the application at blazing speed.

 
  Does anyone have any ideas for how to make .ear deployment go faster?


A n d e r s  B e n g t s s o n [EMAIL PROTECTED]
http://www.natakademin.se/




Re: SV: Faster deployment?

2000-08-04 Thread Anders Bengtsson


We're running all our tests every time we test, so it's hard to separate
things. But I guess that a smart makefile system could automatically
deploy only the changed parts of course...
I'll try that solution when we reach a larger number of deployed beans.

Faster database than an in-memory database? I'll have to get a machine
with a faster memory bus! :)

/Anders

[EMAIL PROTECTED] wrote:
 
 Well we have a project running tremendous amounts of EJBs, but what takes
 time is the Entitybean deployment. We get up to 15 minutes deployment time
 on a P600III on the full deployment.
 
 So what we did to speed up deployment was:
 Divide your application into specialized areas and make ejb-applications of
 them so you can redeploy one area at a time... Then you will only get that
 huge deploy everytime you do a full code refresh. :)..
 The other thing is to get a faster database :)
 
 Hope this helps .
 
 Klaus Myrseth.


A n d e r s  B e n g t s s o n [EMAIL PROTECTED]
http://www.natakademin.se/




Re: SV: Faster deployment?

2000-08-04 Thread Anders Bengtsson

[EMAIL PROTECTED] wrote:
 
 One small warning about JIKES ...
 
 After some thorough swearing we found that JIKES dont support unicode yet,
 so if there is
 possibilities that you have special chars somewhere dont use it.. :)
 
 Other than that its a super fast compiler :)

Actually, the latest Jikes (1.12) has support for different charsets
with the "-encoding" parameter. Unfortunately it seems that it's not
possible to supply that parameter when configuring Orion to use it, so
for JSPs and EJBs that still doesn't work.

/Anders

A n d e r s  B e n g t s s o n [EMAIL PROTECTED]
http://www.natakademin.se/




principals.xml in ear file?

2000-08-01 Thread Anders Bengtsson

Hello,

When I deploy my application, packaged in a .ear file, Orion seems to
"forget" copying the principals.xml file into the
application-deployments directory.

Orion starts with this error:

Error instantiating application at
file:/usr/local/orion/applications/lektor.ear: Couldnt read 
principals config file:
file:/usr/local/orion/application-deployments/lektor/principals.xml for
lektor (/usr/local/orion/application-deployments/lektor/principals.xml
(No such file or directory))

When i copy the principals.xml by hand to its place in
application-deployments everything works fine.

It is the same problem both if I have principals
path="./principals.xml" / defined in orion-application.xml or if I
don't have it defined.

Does anyone else have this problem?

/Anders

A n d e r s  B e n g t s s o n [EMAIL PROTECTED]
http://www.natakademin.se/




Generating primary keys in CMP?

2000-04-25 Thread Anders Bengtsson


Hello,

I'm looking for a way to generate primary keys for my container managed
entity beans.

For bean managed persistance you would simply use the functions that
your DBMS provides, like sequences or auto-increased columns. But how do
I do this with CMP beans? In books and example code everyone avoids the
subject entirely, with
create(int id)
as the creation method.

A solution I've seen suggested is to use a separate session bean to
generate unique integers, but they are generally a mess to implement and
use. So what I'm looking for is something better than that.

The J2EE servers based on object databases (GemStone/J at least) has an
id generator "for free". But it seems this shouldn't be impossible with
relational DBMSes. I would guess that it could be done by the CMP
container, possibly by using DBMS-dependent plugins for different id
generator implementations?

Anyway, if this isn't possible I'm looking for a good implementation of
a session bean based id generator...

/Anders

A n d e r s  B e n g t s s o n [EMAIL PROTECTED]
http://www.natakademin.se/




Wrong content-type for JSP

2000-02-09 Thread Anders Bengtsson


Hello,

I have found some sort of bug with the content-type of JSPs in Orion
0.9.1b.

When I reloaded a JSP-generated page a few times in Netscape I was
suddenly prompted with a "save file" dialog.
I checked with telnet to port 80 on the server machine, and it turned
out that Orion _sometimes_ sends "application/jsp" instead of
"text/html" as the content-type for JSP pages.
In the file config/mime.types the line 
-
application/jsp jsp
-
appears. I guess this is somehow related to the problem...

/Anders

A n d e r s  B e n g t s s o n [EMAIL PROTECTED]
http://www.natakademin.se/