RE: No suitable driver Error.

2003-07-03 Thread Malinescu, Cristian
Hello
Because the 3.1 MySQL Connector/J is alpha state( intended to support the
4.1 alpha release of MySQL DB ) and OJB just release candidate 4( this means
not really stable ) in CVS, I recommend to use the stable 3.0.8 version of
MySQL Connector/J and MySQL 4.0.13; I'm using this versions with no problems
for my deploying my application. 
Best regards,


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Mittwoch, 2. Juli 2003 22:49
To: [EMAIL PROTECTED]
Subject: No suitable driver Error.


Hello all.

I have followed the instructions in downloading and setting up the MySQL 
Connector 3.1, but still get the following error:

[org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl] ERROR: 
Error getting Connection from DriverManager with url 
(jdbc:mysql:rdmostest) and driver (com.mysql.jdbc.Driver)
No suitable driver
java.sql.SQLException: No suitable driver


Does anyone have any ideas what might be wrong here?


The full stack is:
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: 
Create new connection 
pool:[EMAIL PROTECTED]
  jcd-alias=default
  default-connection=true
  dbms=MySQL
  jdbc-level=2.0
  driver=com.mysql.jdbc.Driver
  protocol=jdbc
  sub-protocol=mysql
  db-alias=rdmostest
  user=
  password=*
  eager-release=false
  ConnectionPoolDescriptor={whenExhaustedAction=0, maxIdle=-1, 
maxActive=21, maxWait=5000, removeAbandoned=false, 
numTestsPerEvictionRun=10, testWhileIdle=false, 
minEvictableIdleTimeMillis=60, testOnReturn=false, logAbandoned=false, 
removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, 
testOnBorrow=true}
  batchMode=false
  useAutoCommit=AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
  ignoreAutoCommitExceptions=false
  sequenceDescriptor=null
]
[org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl] ERROR: 
Error getting Connection from DriverManager with url 
(jdbc:mysql:rdmostest) and driver (com.mysql.jdbc.Driver)
No suitable driver
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(DriverManager.java:532)
at java.sql.DriverManager.getConnection(DriverManager.java:172)
at 
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConnectio
nFromDriverManager(Unknown 
Source)
at 
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConPoolFactory
.makeObject(Unknown 
Source)
at 
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo
l.java:710)
at 
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.getConnectionF
romPool(Unknown 
Source)
at 
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConnec
tion(Unknown 
Source)
at 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Unknow
n 
Source)
at 
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(Unknown 
Source)
at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.beginTransaction(Unknown 
Source)
at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.beginTransaction(Unkn
own 
Source)
at 
org.apache.ojb.radu.UCEnterNewUser.apply(UCEnterNewUser.java:30)
at org.apache.ojb.radu.Application.run(Application.java:87)
at org.apache.ojb.radu.Application.main(Application.java:56)
ConnectionManager is NOT in transaction

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Problems with OJB in a servlet container

2003-06-20 Thread Malinescu, Cristian
Hi
We are using OJB in WebLogic and Tomcat without problems,
and we use always the java sdk/vm 1.4.1 for including the 
default XML parser of the standard 1.4.1 API. Can you verify what 
version of JVM you use ?
Regards,
Cristian

-Original Message-
From: Charles Anthony [mailto:[EMAIL PROTECTED]
Sent: Freitag, 20. Juni 2003 12:13
To: 'OJB Users List'
Subject: RE: Problems with OJB in a servlet container 


Hi Mark,

There's some kind of bizarre synchronicity going on here

I was just trying my OJB Webapp in Resin for the first time (minutes ago),
and I got exactly the same problem. It runs fine in Tomcat, and we've had it
going in Websphere too.

I've got a hunch that it may have something to do with a XML
parser/classpath issue, but I could be speaking complete rubbish.

So, I don't think you've missed anything obvious. I can't offer anything
more concrete than that, I'm afraid, and as my knowledge of Resin is rather
less than nothing, I'm not sure I can spend alot of time investigating it
right now.

Has anyone else using OJB + Resin got any hints for us ?

Cheers,

Charles.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 20 June 2003 11:00
To: OJB Users List
Subject: Problems with OJB in a servlet container 


Hi,

I'm new to the world of JDO and OJB, so please bear with me if this is
stupid/straightforward.

I want to use OJB in a servlet container. I wrote a small 
(standalone) test
application to do all the configuration and such. That one works.

I now tried to move everything into a servlet WAR:

- the OJB.properties and repository*.xml files in WEB-INF/classes
- all libraries in WEB-INF/lib
- the code from the standalone app (just creating and 
retrieving an object) into
a java bean that I call from a servlet

But I get a

java.lang.ExceptionInInitializerError
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.
buildDefaultKey(Unknown
Source)
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.
init(Unknown
Source)
...

Is there anything obvious that I'm missing (should any 
libraries or config files
be in the servlet containers lib dir)? What is the best way to 
debug this?

Thanks
MarkS

P.S: I'm using Resin.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



query-customizer sample ?

2003-03-26 Thread Malinescu, Cristian
Hi

Is somewhere there a sample of using the query-customizer element for
collection-descriptor tag ?
Like for the next sample situation, where the Collection getMyXs() for
class Y can be filtered by
field visible ?
regards,
Cristian Malinescu

class-descriptor
class=org.my.X
...

  field-descriptor 
 name=Y_id
 column=Y_ID
 jdbc-type=BIGINT
  /  

  field-descriptor 
 name=visible
 column=VISIBLE
 jdbc-type=SMALLINT
  /  
...

/class-descriptor

class-descriptor
class=org.my.Y
...

  collection-descriptor
 name=myXs
 element-class-ref=org.my.X
 proxy=true

inverse-foreignkey field-ref=Y_id/
  /collection-descriptor
...

/class-descriptor

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to manipulate many repository

2003-03-18 Thread Malinescu, Cristian
Yes, right ...

import org.apache.ojb.broker.PBKey;
import org.apache.ojb.broker.PersistenceBroker;
import org.apache.ojb.broker.PersistenceBrokerFactory;

...

PersistenceBroker myBroker =
PersistenceBrokerFactory.createPersistenceBroker( new PBKey( myPoolAlias)
);

...

that's all ...
regards,
Cristian


-Original Message-
From: TINE Houari (OBJECTIVA) [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 18. März 2003 14:18
To: 'OJB Users List'
Subject: how to manipulate many repository


Hi,

I want to handle many repository in the same projet. But the first parameter
of createPersistenceBroker(RepositoryFile, String, String) don't correspond
of the file name: it seems to correspond to jcd-alias. That right?

Houar

 -Message d'origine-
De :TINE Houari (OBJECTIVA) [mailto:[EMAIL PROTECTED] 
Envoyé :mardi 18 mars 2003 13:59
À : 'OJB Users List'
Objet : RE: how to obtain the SQL code from a Query object?

Hi,

I use P6Spy to see generated sql at runtime.

Houar

 -Message d'origine-
De :Mahler Thomas [mailto:[EMAIL PROTECTED] 
Envoyé :lundi 17 mars 2003 17:46
À : 'OJB Users List'
Objet : RE: how to obtain the SQL code from a Query object?

Mhh,

I don't know all API changes since 0.9.5 by heart, but the
SqlGeneratorFactory is really a very old piece of code.
have a look in the org.apache.ojb.broker.accesslayer.sql package

Maybe you can also instaiate SqlGenerator directly?!

cheers,
Thomas

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 17, 2003 4:30 PM
 To: [EMAIL PROTECTED]
 Subject: RE: how to obtain the SQL code from a Query object?
 
 
 Thomas,
 
 Thanks for your help!
 
 How do you use this SqlGeneratorFactory. This class doesn't 
 seem to be in OJB 0.9.5.
 
 I think that I could migrate to 1.0 but I don't know what 
 exactly I will have to change in my code.
 
 Best.
 Sylvain
 
 -Message d'origine-
 De: Mahler Thomas [mailto:[EMAIL PROTECTED]
 Date: lundi, 17. mars 2003 16:12
 À: 'OJB Users List'
 Objet: RE: how to obtain the SQL code from a Query object?
 
 
 Hi Sylvain,
 
 I think so!
 But you can use the SqlGeneratorFactory to obtain a 
 SqlGenerator instance
 instead!
 
 cheers,
 Thomas
 
  -Original Message-
  From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]
  Sent: Monday, March 17, 2003 3:59 PM
  To: [EMAIL PROTECTED]
  Subject: RE: how to obtain the SQL code from a Query object?
  
  
  Hi Thomas,
  
  I can't find the broker.serviceSqlGenerator() method.
  
  I'm using OJB 0.9.5.
  Is it the problem?
  
  Thanks
  Sylvain
  
  
  
  -Message d'origine-
  De: Mahler Thomas [mailto:[EMAIL PROTECTED]
  Date: lundi, 17. mars 2003 10:59
  À: 'OJB Users List'
  Objet: RE: how to obtain the SQL code from a Query object?
  
  
  The Query object is not able to return SQL code, as it does 
  not have any
  platform specific know how.
  You have to ask the OJB SqlGenerator component to generate SQL:
  
  PersistenceBroker broker = ...
  Query query = ...;
  ClassDescriptor cld = ...;
  
  // obtain prepared stmt sql:
  String sql = 
  broker.serviceSqlGenerator().getPreparedSelectStatement(query,
  cld);
  
  // obtain no prepared sql: 
  sql = 
 broker.serviceSqlGenerator().getSelectStatementDep(query, cld);
  
  cheers,
  thomas
  
   -Original Message-
   From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]
   Sent: Monday, March 17, 2003 10:32 AM
   To: [EMAIL PROTECTED]
   Subject: how to obtain the SQL code from a Query object?
   
   
   Hello,
   
   I have this query:
   
   code
   Criteria crit = new Criteria();
   crit.addEqualTo(workstationName, U68111);
   
   Query query = new QueryByCriteria(Workstation.class, crit, true);
   code
   
   Is there a way to obtain the SQL query (select * from 
   Workstation where) from the query object?
   
   Thanks
   Sylvain
   
   
  
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: performance

2003-03-18 Thread Malinescu, Cristian
Hi
My opinion is basically to take a look at your sourcecode first and
don't forget to index your tables.
For me, for my typical situation/project I can tell next details :
My Oracle 8 database schema for test contains ~ 15 tables with more than 
300 total defined columns, minimum indexed, with 1:n and n:m relations 
using indirection tables, and a total of more than 200.000 entries and a 
complete test suite where full schema is parsed takes under 20 seconds. 
Some development advice is to take care to create in your source code
one PBKey/PersistenceBroker instance and to cache this for later usage.
Regards,
Cristian
  

-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 18. März 2003 15:03
To: OJB Users List (E-mail)
Subject: performance


I am running into a huge performance issue and was hoping to get some
guidance on where to start looking for a problem.  Then mapping portion
causing the problem deals with employees for a company.  I currently have
this modeled as a bi-directional 1:n mapping (Company has a collection of
employees and Employee has a reference to its Company).  Both sides of the
association are set to be proxies (collection-proxy and reference-proxy).

I then tested by loading 2 companies, one with 175 employees and another
with 1524 (the results were pretty much the same querying the Employee
object by its company).  Accessing the employee collection on the first
company took 1.5 secs to load.  Accessing the employee collection on the
second took 2 minutes and 5 secs to load.

Thats not even close to linear, so I am thinking I must be doing something
wrong.  Any help troubleshooting this would be greatly appreciated.  Below
are the mappings for both classes.  I am using the
PersistentFieldMaxPerformanceImpl for the PersistenceFieldClass and a JNDI
Datasource.





!--

###
##   Company entity type mapping

###
--
class-descriptor
class=com.vignette.it.apps.server.domain.entities.Company
table=COMPANY

field-descriptor
name=id
column=COMP_ID
jdbc-type=INTEGER
primarykey=true
autoincrement=true
/

field-descriptor
name=parentId
column=PRNT_COMP_ID
jdbc-type=INTEGER
/

field-descriptor
name=pending
column=PENDING_APPRVL_FLG
jdbc-type=INTEGER
 
conversion=org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo
nversion
/

field-descriptor
name=name
column=NAME
jdbc-type=VARCHAR
/

field-descriptor
name=aliases
column=ALIASES
jdbc-type=VARCHAR
/

field-descriptor
name=numberOfVignetteSites
column=NUM_OF_VIGN_SITES
jdbc-type=INTEGER
/

field-descriptor
name=annualRevenueAmount
column=ANNUAL_REV
jdbc-type=DOUBLE
/

field-descriptor
name=annualRevenueCurrencyId
column=ANNUAL_REV_CURR_ID
jdbc-type=INTEGER
/

field-descriptor
name=potentialOpportunityAmount
column=POTNL_OPP
jdbc-type=DOUBLE
/

field-descriptor
name=potentialOpportunityCurrencyId
column=POTNL_OPP_CURR_ID
jdbc-type=INTEGER
/

field-descriptor
name=fortuneListId
column=FORT_LIST_ID
jdbc-type=INTEGER
/

field-descriptor
name=geographyId
column=GEO_ID
jdbc-type=INTEGER
/

field-descriptor
name=customerStatusId
column=CUST_PROD_STAT_ID
jdbc-type=INTEGER
/

field-descriptor
name=createdBy
column=CRTD_BY
jdbc-type=VARCHAR
/

field-descriptor
name=createdDate
column=CRTD_DT
jdbc-type=TIMESTAMP
 
conversion=org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion
/

field-descriptor
name=modifiedBy
column=CHGD_BY
jdbc-type=VARCHAR
/

field-descriptor
name=modifiedDate
column=CHGD_DT
jdbc-type=TIMESTAMP
 
conversion=org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion
/

reference-descriptor
name=parent
 

RE: performance

2003-03-18 Thread Malinescu, Cristian
Yah,
- TopLink, another fun for another money, I think the days of giant price
schemas for software products are counted fast, friends know why ;-), but
here is not the place to loose time with this.
- 15 tables per module functionality, 
- ok, for 1:N I used the same FK design, correct
success to ojb guys, they rock ...


-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 18. März 2003 15:50
To: 'OJB Users List'
Subject: RE: performance


Yeah, that app-sever is OK for certain things and just piss-poor for
others (but I guess what product isn't like that).  Its Entity Bean support
is not the best around (although I have heard that using TopLink as its CMP
engine is a pretty good solution).

Quick OT question.  How in the world are you modeling a CRM app with only 15
tables? 


Also forgot to mention that I have set up assocaition tables for M:N
relationships, but not for 1:N.  1:N are modeled with a FK on the one-side
table.  That is faster to access from a relational perspective.



-Original Message-
From: Malinescu, Cristian [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 8:43 AM
To: 'OJB Users List'
Subject: RE: performance


Hi, surprising how much similarity, we are doing also some CRM
and we used some commercial appsrv( like t3://myserver:7001 ;-) )
till we become very piss off because of entity ejb performance 
and now we will migrate to tomcat and ojb ( currently 4.1.18/1.0rc1 )
and our performance test are till now very satisfactory ...
Regards,
Cristian

-Original Message-
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 18. März 2003 15:30
To: 'OJB Users List'
Subject: RE: performance


Thanks for the response.

First the database schema is completely normalized.  And unfortunately I
cant work with just 15 tables; this is the begining of a CRM app and phase
one alone has over 300 tables.  All PK and FK are also set up as indexes.
Not that it (should) matter much, but we also use Oracle 8i.

As for the source code, this is just a simple test class (code below) and as
such, there is only one PB instance.  This is not yet even incurring the
overhead of the EJB calls.


public class TestCompanyMappings
{
private static final Logger log = Logger.getRootLogger();

public TestCompanyMappings()
{
System.setProperty( OJB.properties,  properties/OJB.properties
);
System.setProperty( Context.PROVIDER_URL, t3://myserver:7001 );
System.setProperty( Context.INITIAL_CONTEXT_FACTORY,
weblogic.jndi.WLInitialContextFactory );
}

public static void main( String[] args )
{
TestCompanyMappings me = new TestCompanyMappings();
me.execute();
}

private void execute()
{
PersistenceBroker broker = null;
Criteria crit = null;
crit = new Criteria();
crit.addEqualTo( id, new Integer(1) );
Query query = new QueryByCriteria( Company.class, crit );

try
{
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
log.debug( Starting query );
java.util.Collection extent = broker.getCollectionByQuery( query
);
log.debug( Done query; iterating );
java.util.Iterator iter = extent.iterator();
while (iter.hasNext())
{
display( (Company)iter.next() );
}
log.debug( Done iterating );
}
catch( Throwable t )
{
log.error( Error occurred, t );
}
finally
{
if (broker != null)
{
try
{
broker.close();
}
catch( Throwable t )
{}
}
}
}
private void display( Company company )
{
System.out.println(
*** );
System.out.println( ID   :  + company.getId() );
System.out.println( Name :  + company.getName() );
System.out.println(
*** );

log.debug( Forcing load of employees );
System.out.println( First contact last-name :  +
((Contact)company.getEmployees().iterator().next()).getPerson().getLastName(
) );
log.debug( Employees loaded );
}
}



-Original Message-
From: Malinescu, Cristian [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 18, 2003 8:18 AM
To: 'OJB Users List'
Subject: RE: performance


Hi
My opinion is basically to take a look at your sourcecode first and
don't forget to index your tables.
For me, for my typical situation/project I can tell next details :
My Oracle 8 database schema for test contains ~ 15 tables with more than 
300 total defined columns, minimum indexed, with 1:n and n:m relations 
using indirection tables, and a total of more than 200.000 entries and a 
complete test suite where full schema

Generating persistent java classes

2003-03-06 Thread Malinescu, Cristian
Hi

I'm a beginner in using OJB framework and I have a basic question :
Is possible to use OJB for generating skeleton java persistent classes 
based on existing database filled with data ?
Thanks and regards,
Cristian Malinescu

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Thomas Mahler : RE: Generating persistent java classes

2003-03-06 Thread Malinescu, Cristian
Hi
Tried with some hours before both reverse-db, reverse-db2 , no one works.
With reverse-db2 I succeeded to connect to the database ... but that was
all.
Some idea ?
Regards,
Cristian

-Original Message-
From: Thomas Mahler [mailto:[EMAIL PROTECTED]
Sent: Donnerstag, 6. März 2003 18:36
To: OJB Users List
Subject: Re: Generating persistent java classes


try the ant target reverse-db:

ant reverse-db

or bin\build reverse-db

cheers,
Thomas

Malinescu, Cristian wrote:
 Hi
 
 I'm a beginner in using OJB framework and I have a basic question :
 Is possible to use OJB for generating skeleton java persistent classes 
 based on existing database filled with data ?
 Thanks and regards,
 Cristian Malinescu
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]