RE: Problems with CMP/MySQL

2001-09-30 Thread Troy Wong

I had a similar problem but found a fix for it. I assume you are using mm.mysql as 
your jdbc driver:

create table Article (
articleId varchar(100) not null primary key,
churchId varchar(100),
userId varchar(100),
title varchar(100),
content longtext,
createDate datetime,
expirationDate datetime,
expirable enum('t', 'f')
);

I had to modify my table to use enum('t', 'f') instead of bit or tinyint as a boolean 
type, and then it works.

- Brian
-Original Message-
From: Roozbeh Ghaffari <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Subject: Problems with CMP/MySQL
Date: Sun Sep 30 08:38:18 GMT 2001

Hi All,
 
We use Orion CMP features with MySQL. We had problems with boolean and
char fields.
I used P6Spy (www.provision6.com)  to see SQL commands generated by
Orion. 
Orion says:
update table_name set boolean_field = 'true'
but MySQL expects
update table_name set boolean_field = '1'
 
How can I ask Orion to generate the expected SQL?
 
But in case of character field we have a bigger problem.
I try to set a character field to 'F' or 'M'
Orion says:
update table_name set char_field = 0
!!!
I don't understand what is happening!
 
Thank you in advance,
Roozbeh/



RE: RE: Stored procedures and J2EE

2001-09-08 Thread Troy Wong

The whole point of n-tier distributed programming is to keep business logic outside of 
the database layer.

Stored Procedures do have performance benefits, but it's much better from a design 
perspective to keep all logic in the middle layer and leave the database as a dumb 
persistence layer.

Some would say that it's better to incorporate all the logic in the data layer and so 
multiple applications can call it without need to reduplicate code. But the same thing 
can be said of having the logic reside in the middle layer, where you also have the 
benefits of a strong OO machine independent language.

- Brian Chan ([EMAIL PROTECTED])

-Original Message-
From: Frank Eggink <[EMAIL PROTECTED]>
To: Orion-Interest <[EMAIL PROTECTED]>
Subject: RE: Stored procedures and J2EE
Date: Sat Sep 08 08:07:53 GMT 2001

Is it correct to state that from a performance and design perspective using stored 
procedures is helpfull if you need
access from outside the J2EE environment?

If no out side access is necessary, the stored procedures are likely to be helpfull 
for perfomance if they filter out a
lot of data or when you are using recursive logic (this way you are reducing the 
overhead of the remote calls), or am
I missing a point with respect to performance differences between Stored Procedures 
and plain old SQL?


Further more I realize now Stored Procedures are an interesting option in case of 
severe security requirements. You
can differentiate access constraints to the Stored Procedures and minimise the amount 
off people / systems that
have full access to you system.

FE




On Thursday, September 06, 2001 8:08 PM, Juan Lorandi (Chile) 
[SMTP:[EMAIL PROTECTED]] wrote:
> I (empirically) reached the same conclusion; but instead of dropping CMP, we
> provided performance improvements ON TOP of the EJB's (VO's and VO caches).
> Thank god we did it this way, because the DB can't scale as easily as the
> app-server cluster.
>  
> My 2c,
>  
> JP
> 
> -Original Message-
> From: Rian Schmidt [mailto:[EMAIL PROTECTED]]
> Sent: Jueves, 06 de Septiembre de 2001 12:51
> To: Orion-Interest
> Subject: Re: Stored procedures and J2EE
> 
> 
> I'm interested as to how you can say this... we just did a series of tests
> here to see what the effect of pulling out some fairly complex stored
> procedures into CMP beans, and the performance impact was enormous.  We've
> actually gone the other way, that is, developing stored procedures for each
> anticipated database.  The fallback is that the logic is done in the beans,
> but that is a worst-case scenario.  Now, I realize that this would be
> considered such bad form in a Sun-controlled world of pure J2EE that I
> hesitate to even mention it... but in the real world, any significant hit on
> performance is enough to convince us to denormalize a bit, so to speak.
>  
> I don't think that you can say "there's absolutely no hit on performance"
> not to use stored procedures, particularly if that procedure requires
> repeated queries of the data in a pseudo-recursive way.  Do you really think
> that any performance hit that we've seen is a result of poor design?  I'm
> really interested in your reasoning.
>  
> Rian
> 
> - Original Message - 
> From: The   elephantwalker 
> To: Orion-Interest   
> Sent: Thursday, September 06, 2001 2:23 AM
> Subject: RE: Stored procedures and J2EE
>  
> As for distributing your business logic between the datastore and middle
> tier...aren't you making your life more complex than it needs to be? There
> is absolutely no hit on performance if you pull out all of your business
> logic into a slsb or cmp...there's just no need to use store procedures any
> more.
>  
> 
>  << File: ATT0.html >>