RE: MySQL Connection Pool?

2002-04-26 Thread Koster, K.J.

Dear All,

> 
> what about the database schema?
> 
http://kjkoster.org/java/ Hunt around in the menue for MySQL connection for
Orion. It's somewhere near the Tomcat tutorial.

Kees Jan

=
 You can't have everything.  Where would you put it?
 [Steven Wright]




Registering EJB's on the fly

2001-07-10 Thread Koster, K.J.

Dear All,

I'm wondering how I can register EJB's on the fly in Orion. Say I have a
bean that is registered and known. As the program runs I decide I also want
it registered under a different name in the JNDI registry.

thus, in pseudo code:
BeanBHome b = lookup("ejb/BeanB"); // ok, fine
BeanBHome c = lookup("ejb/BeanC"); // *agk!* fails
jndi.register("ejb/BeanC", BeanBHome);
BeanBHome c = lookup("ejb/BeanC"); // ah, now it works!

Is this possible?

Kees Jan


 You are only young once,
   but you can stay immature all your life.





RE: Orin cpu usage ???

2001-05-30 Thread Koster, K.J.

>
> Doesn't anyone knows how to execute
> java -classic .. on a Linux box ??
>
Manually edit $JAVA_HOME/jre/lib/jvm.cfg (path may be different, but it's
definedly jvm.cfg. Move -classic from the bottom of the file to the top.

Kees Jan


 You are only young once,
   but you can stay immature all your life.




RE: Tracing SQL

2001-05-30 Thread Koster, K.J.

Thanks, I've downloaded it and will try it later.

Kees Jan


 You are only young once,
   but you can stay immature all your life.


> -Original Message-
> From: Marcel Schutte [mailto:[EMAIL PROTECTED]]
> Sent: woensdag 30 mei 2001 9:00
> To: Orion-Interest
> Subject: RE: Tracing SQL
> 
> 
> You can find the jdbc logger at 
> http://marcel.schutte.com/DriverWrapper.zip.
> It is certainly not a finished product, just some classes to 
> get you on your
> way.
> 
> Unzip in /lib. In data-sources.xml you have to use
> nl.gx.common.jcbc.DriverWrapper instead of your original 
> database driver.
> 
> Hope this helps,
> Marcel
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of
> > Marcel Schutte
> > Sent: Wednesday, May 30, 2001 12:22 AM
> > To: Orion-Interest
> > Subject: Re: Tracing SQL
> >
> >
> > That's right, I've got it at my daytime (work) PC. Look into
> > it tomorrow
> > morning (GMT+1). Right now I'm enjoying some winamp plugins 
> and wine.
> >
> > Marcel
> >
> > - Original Message -
> > From: "Jeff Schnitzer" <[EMAIL PROTECTED]>
> > To: "Orion-Interest" <[EMAIL PROTECTED]>
> > Sent: Tuesday, May 29, 2001 10:31 PM
> > Subject: RE: Tracing SQL
> >
> >
> > > I don't believe there is any way to force Orion to spit out that
> > > information.  However, when running against Hypersonic in
> > server mode,
> > > you see all the SQL on the database console.  I find this to be an
> > > excellent arrangement for development.
> > >
> > > If you wanted to, you could fairly easily write a JDBC 
> wrapper that
> > > prints the SQL.  I wouldn't be surprised if someone has
> > already written
> > > such a creature.
> > >
> > > Jeff
> > >
> > > > -Original Message-
> > > > From: Koster, K.J. [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, May 29, 2001 1:03 PM
> > > > To: Orion-Interest
> > > > Subject: Tracing SQL
> > > >
> > > >
> > > > Dear All,
> > > >
> > > > I'm having some trouble finding what Orion is doing in my
> > > > databases. I get
> > > > truncated data without any error messages.
> > > >
> > > > How can I see what SQL statements Orion executes? (MySQL,
> > > > with the mm-mysql
> > > > driver, if that matters).
> > > >
> > > > When I have a Java long datatype for a CMP property on an
> > > > enity bean. It's
> > > > mapped to int(11) in the database. How come the values are
> > > > truncated? Who is
> > > > clipping my longs?
> > > >
> > > > Kees Jan
> > > >
> > > > 
> > > >  You are only young once,
> > > >but you can stay immature all your life.
> > > >
> > > >
> > > >
> > >
> >
> >
> >
> 
> 




RE: Tracing SQL

2001-05-30 Thread Koster, K.J.

Dear Josh,
 
Thanks for the info.

Kees Jan 

 
 You are only young once, 
   but you can stay immature all your life. 

 

-Original Message-
From: Josh P. Motto [mailto:[EMAIL PROTECTED]]
Sent: dinsdag 29 mei 2001 22:38
To: Orion-Interest
Subject: Re: Tracing SQL



 Here is the JDBC debugging calls for Orion... just put them in your orion
start statement using -D... for example "java -Ddatasource.verbose
-Djdbc.debug -jar orion.jar" 

Property nameDescription
datasource.verbose   Setting this to true gives you verbose info on
datasource-creation. When a new datasource is created (at startup) it will
print something like this to the console: "jdbc:HypersonicSQL:defaultdb:
Started" or "Orion Pooled jdbc:oracle:thin:@test.foo.com:1521:oracle8i:
Started". You will also be notified when connections are opened, when
connections are released to the pool, etc.  
jdbc.debug   Setting this to true gives you some very verbose
information when jdbc calls are made. This information is not as useful as
the one for datasource.verbose. 
jdbc.nontx.autocommitCan be used to set whether autocommit should be on
for non-transaction connections. Specify false to turn it off, normally it
is on.  
jdbc.connection.debugIf you are having trouble with leaking jdbc
connections, set this to true to find out where the leaked connection was
created.
debug.jdbc.check Set this to true to perform additional tests when
using jdbc.debug="true".

  "Koster, K.J." <[EMAIL PROTECTED]> wrote: 


Dear All,

I'm having some trouble finding what Orion is doing in my databases. I get
truncated data without any error messages.

How can I see what SQL statements Orion executes? (MySQL, with the mm-mysql
driver, if that matters).

When I have a Java long datatype for a CMP property on an enity bean. It's
mapped to int(11) in the database. How come the values are truncated? Who is
clipping my longs?

Kees Jan


You are only young once,
but you can stay immature all your life.






  _  

Do You Yahoo!?
Yahoo! Auctions $2 Million Sweepstakes - Got something to sell?





Tracing SQL

2001-05-29 Thread Koster, K.J.

Dear All,

I'm having some trouble finding what Orion is doing in my databases. I get
truncated data without any error messages.

How can I see what SQL statements Orion executes? (MySQL, with the mm-mysql
driver, if that matters).

When I have a Java long datatype for a CMP property on an enity bean. It's
mapped to int(11) in the database. How come the values are truncated? Who is
clipping my longs?

Kees Jan


 You are only young once,
   but you can stay immature all your life.





Boolean CMP properties in MySQL

2001-05-29 Thread Koster, K.J.

Dear All,

I have a boolean property on an CMP entity bean. In the MySQL database I see
this type mapped to TINYINT(1), which is fine I guess.

Question one: I vaguely remember that the JavaBeans spec says that boolean
properties should have setFoo()/isFoo() instead of the setFOo()/getFoo()
combo. What's EJB's stance on this?

Question two: why does the value of the boolean stay at 0 (not NULL, so the
value is actually written) for either true or false in the database. It's
kind'a hard to distinguish true from false if they both map to 0. :-)

Kees Jan


 You are only young once,
   but you can stay immature all your life.





RE: Counter gives naming exception

2001-05-29 Thread Koster, K.J.

Dear All,

> > 
> > Yet when I use that thing inside the ejbCreate of another 
> bean I get a
> > NameNotFound Exception. Replacing the 
> Counterutils.getnextid() with (new
> > Date()).getTime() works without generating the errors.
> 
> You will probably want to move the ejb-ref from web.xml to ejb-jar.xml
> (into the entity/session element for the bean in whose 
> ejbCreate method you try to lookup CounterHome).
>
Hmm? Ok, it makes sense. I'll try that.

> 
> Markus Holmberg |   Give me Unix or give me a typewriter.
> [EMAIL PROTECTED]  |   http://www.freebsd.org/
> 
Ah, a fellow FreeBSD user. :-) Just curious, what are your experiences with
Orion on FreeBSD? What JDK do you use?

Kees Jan


 You are only young once,
   but you can stay immature all your life.




Counter gives naming exception

2001-05-28 Thread Koster, K.J.

Dear All,

I'm sure I must be doing something dumb, but I've banging my head into this
stupid wall for two days now. I should have stayed in school and learned
something, but nooo, I had to do Computer Science. *argh!* :-)

I deployed the counter.jar (yes it's in the ear, it even autocreates the
table it needs, but never uses). I have included the relevant bits into
web.xml (from $ORION/applications/myapp/webthingy/WEB-INF/web.xml):

  
ejb/Counter
Entity
com.evermind.ejb.CounterHome
com.evermind.ejb.Counter
  

Yet when I use that thing inside the ejbCreate of another bean I get a
NameNotFound Exception. Replacing the Counterutils.getnextid() with (new
Date()).getTime() works without generating the errors.

How can I view the contents of the JNDI directory that Orion has? It would
be sooo helpful in debugging.

What is so obvious that I missed it?

Kees Jan


 You are only young once,
   but you can stay immature all your life.





RE: remote deployment, how?

2001-04-17 Thread Koster, K.J.

Dear Daniele,

>
> Thers is no need to use the Orion's "-admin" option to deploy an
> application. I usually rely on the auto-deploy feature of Orion
> which trigger timestamp changes on the .ear file.
> A remote deployment is easy if you use the "rsync" utility
> (http://rsync.samba.org) that provides fast incremental file transfer
> over the network.
> Rsync mangle the file name until the trasfer is complete so there is
> non need to perform an additional rename of the file or a restart
> of the server.
>
I like the idea of using rsync. So obvious that I missed it completely.
Unfortunately I'm dealing with some non-UNIX development boxes, and rsync
does not seem to be available for those.

Kees Jan


 You are only young once,
   but you can stay immature all your life.




RE: remote deployment, how?

2001-04-17 Thread Koster, K.J.

Dear Bill,

> 
> I dont like the underscore prefixing either, particularly in 
> my development environment.
>
Not to mention the rate you go through diskspace on an average working day.
:-)

>
> At present, on my development wkstation, I manually replace 
> the ear file in
> orion/applications while the server is running. This triggers 
> auto-unpack
> and redeploy without underscore renaming.  Previously, I used 
> the -deploy option of the admin.jar utility which does result in 
> underscore renaming.
>
Hmmm. I found that -deploy works only for non-root websites when I rebind
the web context after -deploy. Root contexts require an Orion restart. This
is annoying for our case (four root websites, no non-root ones, Murphy at
work?).

>
> Slamming an ear into the running server like this does avoid renaming
> behavior, but I've found that it does not work on all our development
> wkstations, for reasons I have not nailed down.  In some 
> cases, auto-unpack
> fails with a diagnostic like 'zip file format error', when the file is
> flawless.  The work-around in that case is to stop the server 
> replace the ear file in orion/applications and then startup the server.
>
The .ear auto deployment is very sensitive to clock synchronisation issues.
NTP is your friend.

I have not seen that "zip file format error", but I imagine that may be due
to Orion starting to autodeploy the file before it is fully in place. Using
mv instead of cp may help, as long as you're on the same filesystem.

>
> I intend to put the work around into our ant deployment 
> script (let it stop
> and startup orion) but have not done so yet. I've used 
> admin.jar across the
> network ok, so given a shared file system, this klunky 
> approach should work
> as a remote deployment technique for enterprise apps that 
> does not result in underscore renaming.
>
I'll probably just stick with FTP instead. These are techs, they should know
FTP.

Thanks for the tips. I'll hack at amdin.jar a little more later today.

Kees Jan


 You are only young once,
   but you can stay immature all your life.




remote deployment, how?

2001-04-13 Thread Koster, K.J.

Dear All,

I would like to be able to deploy an .ear remotely (the servers run FreeBSD,
some of the development workstations use Windows). I found that admin.jar
can do this, and that the new application is indeed uploaded to the server.
It is not automatically deployed in place of the old one.

What I do now (more or less) is this:

  java -jar admin.jar ormi://bladibla admin passwd \
-deploy -file doc.ear -deploymentName doc

I see that the new file shows up in $ORION/applications, prefixed with an
underscore. Repeatedly deploying the same file gives me lots of folders with
ever more underscores (_doc, __doc, ___doc, etc), but changes to .jsp files
in the .ear are not visible over the web.

What I want to do is upload a new version of the application archive in
place of the old one, auto-deploying the thing. Question is: how do I do
that?

Kees Jan


 You are only young once,
   but you can stay immature all your life.





RE: changing database for the CMP primer...

2001-04-06 Thread Koster, K.J.

Dear Peter,

> 
> Sorry if this is a dumb question, but i need to know.
> I want to take the CMP Primer and use another database, 
> Sybase, InterBase etc..
>
You can change the default data source in $ORION/config/data-sources.xml.
I've got a short howto on my website, I posted the link earlier under
"remote MySQL" or something.

http://kjkoster.org/java/index.jsp?page=content/packages.jsp&id=hd07

Kees Jan


 You are only young once,
   but you can stay immature all your life.




Short Orion/remote MySQL howto

2001-04-06 Thread Koster, K.J.

Dear All,

I've written a short howto on setting up Orion with MySQL on FreeBSD,
including some info on how set up privileges to connect to a remote MySQL
database.

http://kjkoster.org/java/index.jsp?page=content/packages.jsp&id=hd07

Kees Jan


 You are only young once,
   but you can stay immature all your life.





RE: Datasource confusion

2001-04-06 Thread Koster, K.J.

Dear All,

I've nailed the problem. I removed the datasource definition from the
ejb-jar.xml and placed one in ~orion/config/data-sources.xml. After
rebuilding the application I stopped Orion, wiped out the
~orion/application-deployments directory, and restarted Orion.

I now get remote access denied errors from the database server, which is
good. :-)

> 
> This line jdbc:mysql://luggage/log is not complete and
> consider mysql local.
>
Umm. Well, this is the precise URL that I use now. Just for the record, the
database server is named "luggage" and the database is called "log". MySQL
server is running on the default port, so I don't have to specify that.

Thanks for the quick responses. I'm going away now to get some harder
problems for you to help me with. :-)


Ah, while I'm on the line: I tried finding information about JMS, but all I
can find are tutorials for local examples. I want to set up a message queue
between two machines. I'd like to know a little about the implementation of
JMS, so that I can get an idea about performance pitfalls and such.


Kees Jan


 You are only young once,
   but you can stay immature all your life.




Datasource confusion

2001-04-05 Thread Koster, K.J.

Dear All,

I am trying to use MySQL and Orion where the MySQL database is located on a
different host than Orion is.

The beans look up the datasource in JNDI. I've specified the datasource in
in ejb-jar.xml. (The resource-ref thingy) This is found, becasue I no longer
get naming exceptions.

In data-sources.xml,  I have specified the proper database URI
(jdbc:mysql://luggage/log).

However, I get an exception saying that on localhost there is no mysql
database (which is true, 'cuz it's on luggage).

Obviously Orion is feeding the bean a database URI that points to localhost.
How can I tell Orion to use the database on the other machine?

I've tried shouting in the floppy drive, but that does not help either. :-/

Kees Jan


 You are only young once,
   but you can stay immature all your life.