Re: java.lang.StackOverflowError within ODMG

2003-06-26 Thread Thomas Mahler
you should use the validationQuery attribute on the jdbc-connection 
descriptor. the validation query will be executed to check if a 
connection is still alive before using a connection.

cheers,
Thomas
Peter Gaus wrote:
Hi all,

we are using ODMG and have a strange problem:

When we start our application it opens following database-connection:

* CODE **
 Database db   = implementation.newDatabase(); db.open( jcdAlias, 
Database.OPEN_READ_WRITE );
* CODE **

* LOG **
[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=org.gjt.mm.mysql.Driver
 protocol=jdbc
 sub-protocol=mysql
 db-alias=//***/***
 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_FALSE
 ignoreAutoCommitExceptions=false
 
[EMAIL PROTECTED] 

sequenceManagerClass=class 
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
Properties={autoNaming=true, globalSequenceId=false, 
globalSequenceStart=1, grabSize=1}
]
]
* LOG **

We use this db reference in our whole application, the database will 
never be closed.
So far everything works great.

But after some idle hours (typicly over night, when nobody uses our 
server) following problem occurs. Within an OQL query we get following 
exception- trace:
* StackTrace **
see the attached file
* StackTrace **

Should we close the connection in beetween, or what is wrong?

Thanks for your help,

Peter Gaus



java.lang.StackOverflowError
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:113)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:1477)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:1405)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:879)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:917)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1841)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1787)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1768)
at com.mysql.jdbc.Connection.rollbackNoChecks(Connection.java:1369)
at com.mysql.jdbc.Connection.rollback(Connection.java:1356)
at com.mysql.jdbc.Connection.close(Connection.java:1028)
at com.mysql.jdbc.Connection.cleanup(Connection.java:2050)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1853)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1787)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1768)
at com.mysql.jdbc.Connection.rollbackNoChecks(Connection.java:1369)
at com.mysql.jdbc.Connection.rollback(Connection.java:1356)
at com.mysql.jdbc.Connection.close(Connection.java:1028)
at com.mysql.jdbc.Connection.cleanup(Connection.java:2050)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1853)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1787)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1768)


ca. 150 times this lines
***
at com.mysql.jdbc.Connection.rollbackNoChecks(Connection.java:1369)
at com.mysql.jdbc.Connection.rollback(Connection.java:1356)
at com.mysql.jdbc.Connection.close(Connection.java:1028)
at com.mysql.jdbc.Connection.cleanup(Connection.java:2050)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1853)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1787)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1768)
***
and than:
at com.mysql.jdbc.Connection.rollbackNoChecks(Connection.java:1369)
at com.mysql.jdbc.Connection.rollback(Connection.java:1356)
at com.mysql.jdbc.Connection.close(Connection.java:1028)
at com.mysql.jdbc.Connection.cleanup(Connection.java:2050)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1853)
at 

Re: Dynamic proxies and references Help

2003-06-26 Thread Thomas Mahler
Hi Marcus,

Marcus Breese wrote:
It seems that I'm having problems posting to the list.  At any rate...
It seems you are not subscribed to the list. for post of nun-subscribed 
user a manual affirmation by the list maintainer is required. As I was 
travelling yesterday, there was some delay for these posts...

subscribing to the list will cure the problem ;-)

My main question rests below, however, I seem to have found a 
solution... but not answered my question.  Is it possible to have a 
proxied reference within a class that is already dynamic proxied?  If I 
have a reference that is proxy=true, I get metadata errors.  If I set 
proxy=false (in reference), I get no errors...

Is this right?

Is it possible to have recursive references while using a dynamic proxy?

For example, I have a Project class where each project can track its
parent project.
The class is laid out as such:

Project
|- id
|- name
|- parentid
|- parentidObject
Project has an interface IProject.  Also, Id, Name and parentid are
inherited from a base class.
I can retrieve the Project fine via a dynamic proxy, but when I try to
get the parentIdObject, I get the following error:
13:52:49,838 - ERROR
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl -
while set field:
object class[ edu.iupui.cmg.labratj.om.Project
target field: parentIdObject
target field type: interface edu.iupui.cmg.labratj.om.IProject
object value class: $Proxy5
object value: Name: Test Project
Id: 1
PiId: 1
]
Can anyone see where I'm going wrong?

-=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-= -=-=-
Marcus Breese[EMAIL PROTECTED]
IU School of Medicine  [EMAIL PROTECTED]
Dept. of Biochemistry and Molecular Biology
Center for Medical Genomics / Grow Lab


-
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]


ojb-servlet WebApp on Tomcat

2003-06-26 Thread Gerhard Kreutzer
Hello,

I will use OJB in a web application running on Tomcat 4.1.24 using JDK 
1.4.1 on a Win2K box.

After installing OJB 1.0.rc3, the check bin\build junit runs properly. 
The tutorial1 works fine also.
Now, i create the ojb-servlet webapp and deploy it to tomcat webapps. 
Tomcat greater 4.1.10 need a deployment descriptor file for invoking 
servlets:

my web.xml --
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
   PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
 display-nameApache OJB V1.0 28.6.2003/display-name
   description WebApp for Apache OJB V1.0 28.6.2003 
KreutzerSoft.de/description

 servlet
   servlet-name TestServlet /servlet-name
   servlet-class org.apache.ojb.servlet.TestServlet /servlet-class
 /servlet
 servlet-mapping
   servlet-nameTestServlet/servlet-name
 url-pattern/servlet/TestServlet/url-pattern
   /servlet-mapping
   !-- Nachfolgendes mapping aktivieren für 4.1.10 Kompatibilität
!in produktiven System deaktivieren!
   --
 servlet-mapping
   servlet-nameinvoker/servlet-name
   url-pattern/servlet/*/url-pattern
 /servlet-mapping
/web-app
-
Calling the Servlet via 
http://localhost:8080/ojb-servlet/servletTestServlet throws the 
following Exception:

*root cause*

java.lang.NoClassDefFoundError
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source)
at org.apache.ojb.servlet.TestServlet.getBroker(Unknown Source)
at org.apache.ojb.servlet.TestServlet.getTableIterator(Unknown Source)
at org.apache.ojb.servlet.TestServlet.doGet(Unknown Source)
.
The db-ojb-1.0.rc3.jar containing the class org.apache.ojb.broker.PersistenceBrokerFactory is installed in the right place in WEB-INF/lib.

Where I'm going wrong. Can anywon help me.

Thanks,
gerhard
--
KreutzerSoft
Bärenbühlgraben 76, 90475 Nürnberg
Tel: +49-911-8324-57
Fax: +49-911-8324-61
mailto:[EMAIL PROTECTED]
http://www.KreutzerSoft.de 



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


Re: web app in jboss -- where to put files?

2003-06-26 Thread Armin Waibel
Hi,

 Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
read
 repository class descriptor data, using repository: repository.xml:
Error
 creating PersistentField:
de.arvatosystems.monitoring.business.vo.CoreVO,
 entryID

seems the repository file was found, but maybe it's corrupt.
Please check your repository file - in particular repository_user.xml
for CoreVO.
Or OJB can not instantiate PersistentField object for 'entryID'.
There should be a stack trace caused by PersistentFieldFactory
say what's going wrong.

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 1:49 PM
Subject: web app in jboss -- where to put files?


 Hello!

 I have a generall questions. I have a web application deployed on
jboss
 3.0.6. I want to use OJB for persistence in that web application. I
want to
 able to use my preconfigured datasource.

 I followed the steps in the documentation how to deploy ojb on jboss
which
 means that I created the ojb.sar folder with the neccessary archives.
My
 question is now:

 Where do I put my repository files needed for the persistence for my
web
 application? In the ojb.sar folder or in the WEB-INF folder of my web
app?

 I tried to put it in the ojb.sar folder but I get exception when
trying to
 get:

 Implementation odmg = factory.getInstance();

 Here is the stack trace:

 java.lang.ExceptionInInitializerError
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
ultK
 ey(Unknown Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.init(Un
know
 n Source)
 at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 at
 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructo
rAcces
 sorImpl.java:39)
 at

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
truc
 torAccessorImpl.java:27)
 at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 at java.lang.Class.newInstance0(Class.java:306)
 at java.lang.Class.newInstance(Class.java:259)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
 Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.clinit(Unkn
own
 Source)
 at
 org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown
 Source)
 at org.apache.ojb.odmg.OJBJ2EE_2.getInstance(Unknown Source)
 at org.apache.ojb.jboss.ODMGFactory.getInstance(Unknown
Source)
 at

de.arvatosystems.monitoring.business.scheduler.InitServlet.init(InitServ
let.
 java:180)
 

 Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
read
 repository class descriptor data, using repository: repository.xml:
Error
 creating PersistentField:
de.arvatosystems.monitoring.business.vo.CoreVO,
 entryID
 at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown
 Source)
 at
org.apache.ojb.broker.metadata.MetadataManager.init(Unknown
 Source)
 at
org.apache.ojb.broker.metadata.MetadataManager.clinit(Unknown
 Source)
 ... 69 more


 CoreVO with the attribute entryID is the first class and field
descriptor in
 my repository_user.xml

 Where is my mistake?

 Thanks, Julia.

 -
 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: ToDo list very empty

2003-06-26 Thread Alen Ribic
thx Thomas

--Alen


- Original Message -
From: Thomas Mahler [EMAIL PROTECTED]
To: OJB Users List [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 7:57 AM
Subject: Re: ToDo list very empty


 Hi ALen,

 here is a list that is not that empty:
 http://scarab.werken.com/scarab/issues/

 cheers,
 Thomas

 Alen Ribic wrote:
  Hello
 
  Where is the ToDo list or is everything done? bugs? new
functionality.?
  :-)
  http://db.apache.org/ojb/todo.html shows nothing.
  I just wanted to put some spare time maybe into contribution.
 
  ciao
  --Alen
 
 
  -
  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: abort transaction causes TransactionNotInProgressException

2003-06-26 Thread Joerg Lensing
Joerg Lensing schrieb:

hi armin,
i think my problem is, that LocalTxManager.getCurrentTransaction() 
doesn't succed, because the
transaction is registred to different thread 
(tx_table.get(Thread.currentThread())---) . I'm using struts
and the transaction is saved to the session. when the thread (here: 
the key used for tx_table)changes, the transaction
can't be found.
What is the correct handling?

joerg

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

hi armin,
i get it to work now.  before commit()/checkpoint()/abort() i call
transaction.join().
is this the right way?
joerg

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


Re: abort transaction causes TransactionNotInProgressException

2003-06-26 Thread Armin Waibel
yep I think so.
(We don't have a test case for 'join()'.
Please let me know if you detect side effects)

regards,
Armin

- Original Message -
From: Joerg Lensing [EMAIL PROTECTED]
To: OJB Users List [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 8:54 AM
Subject: Re: abort transaction causes TransactionNotInProgressException


 Joerg Lensing schrieb:

  hi armin,
  i think my problem is, that LocalTxManager.getCurrentTransaction()
  doesn't succed, because the
  transaction is registred to different thread
  (tx_table.get(Thread.currentThread())---) . I'm using struts
  and the transaction is saved to the session. when the thread (here:
  the key used for tx_table)changes, the transaction
  can't be found.
  What is the correct handling?
 
  joerg
 
 

 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 hi armin,
 i get it to work now.  before commit()/checkpoint()/abort() i call
 transaction.join().
 is this the right way?

 joerg


 -
 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]



AW: web app in jboss -- where to put files?

2003-06-26 Thread Julia . Winkler
Hello Jim,

but it seems to use the write file because otherwise it wouldn't have found
the declaration of the CoreVO class. Or does this indicate that can not find
the class CoreVFo? But I would then expect a NoClassDefFoundError.

Other suggestions?

Julia

-Ursprüngliche Nachricht-
Von: Jim Shingler [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 25. Juni 2003 23:06
An: 'OJB Users List'
Betreff: RE: web app in jboss -- where to put files?


Not sure where you need to but the files but it means that OJB couldn't
find them when it was initialized.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Wednesday, June 25, 2003 10:34 AM
To: [EMAIL PROTECTED]
Subject: AW: web app in jboss -- where to put files?


Hello,

I'm still having the same problems. I set the log level to debug but
this could not give me more detailed informations. What does the
following error
mean:

 org.apache.ojb.broker.metadata.MetadataException: Could not read
repository class descriptor data, using repository: repository.xml:
Error creating
PersistentField: de.arvatosystems.monitoring.business.vo.CoreVO, entryID

I attache my repository_database.xml and repositor_user.xml.

If anyone could have a look on it, it would be really great!

I am thankful for any suggestions.

thanks, julia.

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 25. Juni 2003 13:50
An: [EMAIL PROTECTED]
Betreff: web app in jboss -- where to put files?


Hello!

I have a generall questions. I have a web application deployed on jboss
3.0.6. I want to use OJB for persistence in that web application. I want
to able to use my preconfigured datasource.

I followed the steps in the documentation how to deploy ojb on jboss
which means that I created the ojb.sar folder with the neccessary
archives. My question is now:

Where do I put my repository files needed for the persistence for my web
application? In the ojb.sar folder or in the WEB-INF folder of my web
app?

I tried to put it in the ojb.sar folder but I get exception when trying
to
get:

Implementation odmg = factory.getInstance();

Here is the stack trace:

java.lang.ExceptionInInitializerError
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
ultK
ey(Unknown Source)
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.init(Un
know
n Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cces
sorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
truc
torAccessorImpl.java:27)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:306)
at java.lang.Class.newInstance(Class.java:259)
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
Source)
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.clinit(Unkn
own
Source)
at
org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown
Source)
at org.apache.ojb.odmg.OJBJ2EE_2.getInstance(Unknown Source)
at org.apache.ojb.jboss.ODMGFactory.getInstance(Unknown Source)
at
de.arvatosystems.monitoring.business.scheduler.InitServlet.init(InitServ
let.
java:180)


Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not
read repository class descriptor data, using repository: repository.xml:
Error creating PersistentField:
de.arvatosystems.monitoring.business.vo.CoreVO,
entryID
at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown
Source)
at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown
Source)
at
org.apache.ojb.broker.metadata.MetadataManager.clinit(Unknown
Source)
... 69 more


CoreVO with the attribute entryID is the first class and field
descriptor in my repository_user.xml

Where is my mistake?

Thanks, Julia.

-
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: [jBoss] multiuser problems

2003-06-26 Thread Armin Waibel
Hi Phil,

- exhausted DataSource pool (db-connection pool, jboss)?
 
  I use default settings for the OracleDS, should this be changed in
  oracle-service.xml?

I'm not a database guy, but on second thoughts I think this
can't be the problem (missing exhausted/timeout exception).

On the dev list some user reported about a deadlock
http://article.gmane.org/gmane.comp.jakarta.ojb.devel/2971
maybe this will solve your problem too.

regards,
Armin

- Original Message -
From: Phil Warrick [EMAIL PROTECTED]
To: Phil Warrick [EMAIL PROTECTED]; OJB Users List
[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 4:36 AM
Subject: Re: [jBoss] multiuser problems


 Hi Armin,

 In fact, my oracle-service.xml is as follows:

 ?xml version=1.0 encoding=UTF-8?

 !--

= --

 !--
 --
 !--  JBoss Server Configuration
 --
 !--
 --
 !--

= --


 server

!--

 --
!-- ConnectionManager setup for Oracle dbs
   --
!-- Build jmx-api (build/build.sh all) and view for config
 documentation --
!-- Thanks to Steven Coy
   --
!--

 --

mbean
 code=org.jboss.resource.connectionmanager.LocalTxConnectionManager
 name=jboss.jca:service=LocalTxCM,name=OracleDS


  !-- Include a login module configuration named OracleDbRealm.
   Update your login-conf.xml, here is an example for a
   ConfiguredIdentityLoginModule:

  application-policy name = OracleDbRealm
 authentication
login-module code =
 org.jboss.resource.security.ConfiguredIdentityLoginModule flag =
 required
   module-option name =
 principalyourprincipal/module-option
   module-option name =
userNameyourusername/module-option
   module-option name =
passwordyourpassword/module-option
   module-option name =

managedConnectionFactoryNamejboss.jca:service=LocalTxCM,name=OracleDS
/module-option
/login-module
 /authentication
  /application-policy

  NOTE: the application-policy name attribute must match
 SecurityDomainJndiName, and the
module-option name = managedConnectionFactoryName
  must match the object name of the ConnectionManager you are
 configuring here.
  --

  !--uncomment out this line if you are using the OracleDbRealm
above
  attribute
name=SecurityDomainJndiNameOracleDbRealm/attribute
  --

  depends optional-attribute-name=ManagedConnectionFactoryName
!--embedded mbean--
mbean
code=org.jboss.resource.connectionmanager.RARDeployment
 name=jboss.jca:service=LocalTxDS,name=OracleDS

  attribute name=JndiNameOracleDS/attribute

  attribute name=ManagedConnectionFactoryProperties
properties
  config-property name=ConnectionURL

type=java.lang.Stringjdbc:oracle:thin:@127.0.0.1:1521:mondp/config-p
roperty
  config-property name=DriverClass

type=java.lang.Stringoracle.jdbc.driver.OracleDriver/config-property

  !--set these only if you want only default logins, not
 through JAAS --
  config-property name=UserName
 type=java.lang.StringMOND_USER/config-property
  config-property name=Password
 type=java.lang.StringMOND_PASS/config-property
/properties

  /attribute

 !--Below here are advanced properties --
  !--hack--
  depends

optional-attribute-name=OldRarDeploymentjboss.jca:service=RARDeployme
nt,name=JBoss
 LocalTransaction JDBC Wrapper/depends
/mbean
  /depends

  depends optional-attribute-name=ManagedConnectionPool
!--embedded mbean--
mbean
 code=org.jboss.resource.connectionmanager.JBossManagedConnectionPool
 name=jboss.jca:service=LocalTxPool,name=OracleDS

  attribute name=MinSize0/attribute
  attribute name=MaxSize50/attribute
  attribute name=BlockingTimeoutMillis5000/attribute
  attribute name=IdleTimeoutMinutes15/attribute
  !--criteria indicates if Subject (from security domain) or
app
 supplied
  parameters (such as from getConnection(user, pw)) are
used
 to distinguish
  connections in the pool. Choices are
  ByContainerAndApplication (use both),
  ByContainer (use Subject),
  ByApplication (use app supplied params only),
  ByNothing (all connections are equivalent, usually if
 adapter supports
reauthentication)--
  attribute name=CriteriaByContainer/attribute
/mbean

  /depends
  depends

optional-attribute-name=CachedConnectionManagerjboss.jca:service=Cach
edConnectionManager/depends

  depends

optional-attribute-name=JaasSecurityManagerServicejboss.security:serv

Re: A Very Serious problem -- The cursor SQLCUR7 is not in a prepared state

2003-06-26 Thread anuradha devi
Hi Armin,
Thanks for your reply.
It is basically like this. I have two users who logged
on to my application and working on that parallely
that means two different PB instances and contexts.
It happened that both of them hit the same query at
the same time and we got this problem.
Is there any setting in ojb properties file or any
where for to avoid this concurrency problem.

Let me know if you want me to post the code snippets.

Thanks 
Anu
--- Armin Waibel [EMAIL PROTECTED] wrote:
 Hi,
 
  This exception occured twice and when we saw the
 log
  the two exceptions are one after the other and we
 feel
  this could be with concurrent hit to the same
 method.
 
 Could you explain a little more? code snip of the
 method?.
 Do you mean concurrent hit to the same method with
 different
 PB instances or do you use the same PB instance?
 
 regards,
 Armin
 
 - Original Message -
 From: anuradha devi [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2003 7:27 AM
 Subject: A Very Serious problem -- The cursor
 SQLCUR7 is not in a
 prepared state
 
 
  Hi all,
  We are working on a web application which was
  developed on OJB0.9.5.
  The system is very well working normally.
  When it comes performance testing, when 3 users
 tried
  to hit the system concurrently with 2 as maximum
 no.
  of connections at one point we got the following
  exception.
 
  [IBM][CLI Driver][DB2/NT] SQL0514N  The cursor
  SQLCUR7 is not in a prepared state. 
 SQLSTATE=26501
 
  COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI
  Driver][DB2/NT] SQL0514N  The cursor SQLCUR7 is
 not
  in a prepared state.  SQLSTATE=26501
 
  at
 

COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExcepti
 onGenerator.java:260)
  at
 

COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptio
 nGenerator.java(Compiled
  Code))
  at
 

COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptio
 nGenerator.java(Compiled
  Code))
  at
 

COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(DB2PreparedStatement.
 java(Compiled
  Code))
  at
 

COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(DB2PreparedStatem
 ent.java(Compiled
  Code))
  at
 

com.ibm.ejs.cm.cache.CachedStatement.executeQuery(CachedStatement.java(C
 ompiled
  Code))
  at
 

com.ibm.ejs.cm.proxy.PreparedStatementProxy.executeQuery(PreparedStateme
 ntProxy.java(Compiled
  Code))
  at
 

org.apache.ojb.broker.accesslayer.JdbcAccess.executeQuery(Unknown
  Source)
  at
 

org.apache.ojb.broker.accesslayer.RsIterator.init(Unknown
  Source)
  at
 

org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getIteratorFromQuer
 y(Unknown
  Source)
  at
 

org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
 y(Unknown
  Source)
  at
 

org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
 y(Unknown
  Source)
  at
 

org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
 y(Unknown
  Source)
  at
 

org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
 y(Unknown
  Source)
  at
 

org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByQuery(Un
 known
  Source)
  at
 

com.tgt.hr.exm.business.dao.OJBPostOccupantDAO.findPostOccupantByEmpId(O
 JBPostOccupantDAO.java:99)
  at
 

com.tgt.hr.exm.business.process.MiscProcess.getName(MiscProcess.java:236
 )
  at
 

com.tgt.hr.exm.ui.action.BackToMenuAction.emPerform(BackToMenuAction.jav
 a:165)
  at
 

com.tgt.hr.exm.ui.action.AbstractEMAction.perform(AbstractEMAction.java:
 124)
  at
 

org.apache.struts.action.ActionServlet.processActionPerform(ActionServle
 t.java:1787)
  at
 

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
  at
 

org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
  at
 

javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
  at
 

javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
 

com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletMan
 ager.java:827)
  at
 

com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLife
 cycleServlet.java:159)
  at
 

com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleSe
 rvlet.java:286)
  at
 

com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifec
 ycleServlet.java:106)
  at
 

com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.jav
 a:472)
  at
 

com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(Servle
 tManager.java:1012)
  at
 

com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletM
 anager.java:913)
  at
 

com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispat
 ch(WebAppRequestDispatcher.java:499)
  at
 

com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppReq
 uestDispatcher.java:278)
  at
 

com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequ
 estDispatcher.java:105)
  at
 


Re: web app in jboss -- where to put files?

2003-06-26 Thread Armin Waibel
Hi again,

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

ok, but

 Caused by: org.apache.ojb.broker.metadata.MetadataException: Error
creating
 PersistentField: de.arvatosystems.monitoring.business.vo.CoreVO,
entryID
 at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
 at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
 at

indicate that something while parsing the repository file,
in particular CoreVO, is going wrong.
Could you post your repository_user.xml or a snip
showing mapping for CoreVO?

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 9:23 AM
Subject: AW: web app in jboss -- where to put files?


 Hi Armin,

 as I posted before, I think he finds the file or how could he then
know
 about the class CoreVO?

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

 What do you mean by this:
  Or OJB can not instantiate PersistentField object for 'entryID'.

 The stack trace doesn't say very much but I can post it again.

 Thanks, Julia.




 *
 java.lang.ExceptionInInitializerError
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
ultK
 ey(Unknown Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.init(Un
know
 n Source)
 at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 at

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cces
 sorImpl.java:39)
 at

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
truc
 torAccessorImpl.java:27)
 at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 at java.lang.Class.newInstance0(Class.java:306)
 at java.lang.Class.newInstance(Class.java:259)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
 Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.clinit(Unkn
own
 Source)
 at
 org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown
 Source)
 at org.apache.ojb.odmg.OJBJ2EE_2.getInstance(Unknown Source)
 at org.apache.ojb.jboss.ODMGFactory.getInstance(Unknown
Source)
 at

de.arvatosystems.monitoring.business.scheduler.InitServlet.init(InitServ
let.
 java:180)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)
 at
 org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:219)
 at

org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl
er.j
 ava:426)
 at

org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAp
plic
 ationHandler.java:150)
 at

org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont
ext.
 java:490)
 at

org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationConte
xt.j
 ava:85)
 at org.jboss.jetty.Jetty.deploy(Jetty.java:368)
 at
org.jboss.jetty.JettyService.performDeploy(JettyService.java:249)
 at

org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
 at
org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
 at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
 at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
 at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
 at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl
 .java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at

org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDi
spat
 cher.java:284)
 at
 org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
 at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
 at $Proxy3.deploy(Unknown Source)
 at

org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentSc
anne
 r.java:435)
 at

org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeplo
ymen
 tScanner.java:656)
 at

org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScan
ner.
 java:507)
 at

org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(Abst
ract
 DeploymentScanner.java:261)
 at

org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165)
 at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
 at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl
 .java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at

org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDi
spat
 cher.java:284)
 at
 

AW: web app in jboss -- where to put files?

2003-06-26 Thread Julia . Winkler
Hi Armin,

sure I can post it. The Declaration is right at the beginning of the
repository_user.xml:

class-descriptor class=de.arvatosystems.monitoring.business.vo.CoreVO
table=COREVO
extent-class
class-ref=de.arvatosystems.monitoring.business.vo.CoreRpcVO/
extent-class
class-ref=de.arvatosystems.monitoring.business.vo.server.ServerVO/
field-descriptor name=entryID column=ID jdbc-type=INTEGER
primarykey=true/
field-descriptor name=locale column=LOCALE
jdbc-type=VARCHAR/
field-descriptor name=Alias column=ALIAS jdbc-type=VARCHAR/
field-descriptor name=Description column=DESCRIPTION
jdbc-type=VARCHAR/
field-descriptor name=Active column=ACTIVE jdbc-type=INTEGER 

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

conversion=org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo
nversion/
/class-descriptor

Hope this helps.

Julia.

-Ursprüngliche Nachricht-
Von: Armin Waibel [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 26. Juni 2003 09:34
An: OJB Users List
Betreff: Re: web app in jboss -- where to put files?


Hi again,

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

ok, but

 Caused by: org.apache.ojb.broker.metadata.MetadataException: Error
creating
 PersistentField: de.arvatosystems.monitoring.business.vo.CoreVO,
entryID
 at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
 at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
 at

indicate that something while parsing the repository file,
in particular CoreVO, is going wrong.
Could you post your repository_user.xml or a snip
showing mapping for CoreVO?

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 9:23 AM
Subject: AW: web app in jboss -- where to put files?


 Hi Armin,

 as I posted before, I think he finds the file or how could he then
know
 about the class CoreVO?

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

 What do you mean by this:
  Or OJB can not instantiate PersistentField object for 'entryID'.

 The stack trace doesn't say very much but I can post it again.

 Thanks, Julia.




 *
 java.lang.ExceptionInInitializerError
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
ultK
 ey(Unknown Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.init(Un
know
 n Source)
 at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 at

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cces
 sorImpl.java:39)
 at

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
truc
 torAccessorImpl.java:27)
 at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 at java.lang.Class.newInstance0(Class.java:306)
 at java.lang.Class.newInstance(Class.java:259)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
 Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.clinit(Unkn
own
 Source)
 at
 org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown
 Source)
 at org.apache.ojb.odmg.OJBJ2EE_2.getInstance(Unknown Source)
 at org.apache.ojb.jboss.ODMGFactory.getInstance(Unknown
Source)
 at

de.arvatosystems.monitoring.business.scheduler.InitServlet.init(InitServ
let.
 java:180)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)
 at
 org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:219)
 at

org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl
er.j
 ava:426)
 at

org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAp
plic
 ationHandler.java:150)
 at

org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont
ext.
 java:490)
 at

org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationConte
xt.j
 ava:85)
 at org.jboss.jetty.Jetty.deploy(Jetty.java:368)
 at
org.jboss.jetty.JettyService.performDeploy(JettyService.java:249)
 at

org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
 at
org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
 at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
 at
org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
 at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
 at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl
 .java:25)
 at 

Re: web app in jboss -- where to put files?

2003-06-26 Thread Armin Waibel
Hi,

really strange!
I agree, your declaration is ok.
When using OJB standalone, do you get the same
exception when calling
'Implementation odmg = factory.getInstance()' ?

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 9:38 AM
Subject: AW: web app in jboss -- where to put files?


Hi Armin,

sure I can post it. The Declaration is right at the beginning of the
repository_user.xml:

class-descriptor class=de.arvatosystems.monitoring.business.vo.CoreVO
table=COREVO
extent-class
class-ref=de.arvatosystems.monitoring.business.vo.CoreRpcVO/
extent-class
class-ref=de.arvatosystems.monitoring.business.vo.server.ServerVO/
field-descriptor name=entryID column=ID jdbc-type=INTEGER
primarykey=true/
field-descriptor name=locale column=LOCALE
jdbc-type=VARCHAR/
field-descriptor name=Alias column=ALIAS jdbc-type=VARCHAR/
field-descriptor name=Description column=DESCRIPTION
jdbc-type=VARCHAR/
field-descriptor name=Active column=ACTIVE jdbc-type=INTEGER

conversion=org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFie
ldCo
nversion/
field-descriptor name=Monitor column=MONITOR
jdbc-type=INTEGER

conversion=org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFie
ldCo
nversion/
/class-descriptor

Hope this helps.

Julia.

-Ursprüngliche Nachricht-
Von: Armin Waibel [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 26. Juni 2003 09:34
An: OJB Users List
Betreff: Re: web app in jboss -- where to put files?


Hi again,

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

ok, but

 Caused by: org.apache.ojb.broker.metadata.MetadataException: Error
creating
 PersistentField: de.arvatosystems.monitoring.business.vo.CoreVO,
entryID
 at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
 at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
 at

indicate that something while parsing the repository file,
in particular CoreVO, is going wrong.
Could you post your repository_user.xml or a snip
showing mapping for CoreVO?

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 9:23 AM
Subject: AW: web app in jboss -- where to put files?


 Hi Armin,

 as I posted before, I think he finds the file or how could he then
know
 about the class CoreVO?

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

 What do you mean by this:
  Or OJB can not instantiate PersistentField object for 'entryID'.

 The stack trace doesn't say very much but I can post it again.

 Thanks, Julia.




 *
 java.lang.ExceptionInInitializerError
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
ultK
 ey(Unknown Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.init(Un
know
 n Source)
 at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 at

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cces
 sorImpl.java:39)
 at

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
truc
 torAccessorImpl.java:27)
 at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 at java.lang.Class.newInstance0(Class.java:306)
 at java.lang.Class.newInstance(Class.java:259)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
 Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.clinit(Unkn
own
 Source)
 at
 org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown
 Source)
 at org.apache.ojb.odmg.OJBJ2EE_2.getInstance(Unknown Source)
 at org.apache.ojb.jboss.ODMGFactory.getInstance(Unknown
Source)
 at

de.arvatosystems.monitoring.business.scheduler.InitServlet.init(InitServ
let.
 java:180)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)
 at
 org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:219)
 at

org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl
er.j
 ava:426)
 at

org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebAp
plic
 ationHandler.java:150)
 at

org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationCont
ext.
 java:490)
 at

org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationConte
xt.j
 ava:85)
 at org.jboss.jetty.Jetty.deploy(Jetty.java:368)
 at
org.jboss.jetty.JettyService.performDeploy(JettyService.java:249)
 at

org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
 at
org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
 at

AW: web app in jboss -- where to put files?

2003-06-26 Thread Julia . Winkler
Hello Armin,

I'm getting behind the problems!! But still I think it is strange! I wasn't
strict enough with my naming conventions. Some class attributes started with
a capital letter. Also it matched my speeling min the repository file, OJB
wasn't able the create the persistent filed. This seems to be a must that no
attribute shoul start with a capital letter.

Now everything works fine.
Maybe someone should change that.
But thank you Armin. You brought me into the right direction.

Julia.

-Ursprüngliche Nachricht-
Von: Armin Waibel [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 26. Juni 2003 10:00
An: OJB Users List
Betreff: Re: web app in jboss -- where to put files?


Hi,

really strange!
I agree, your declaration is ok.
When using OJB standalone, do you get the same
exception when calling
'Implementation odmg = factory.getInstance()' ?

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 9:38 AM
Subject: AW: web app in jboss -- where to put files?


Hi Armin,

sure I can post it. The Declaration is right at the beginning of the
repository_user.xml:

class-descriptor class=de.arvatosystems.monitoring.business.vo.CoreVO
table=COREVO
extent-class
class-ref=de.arvatosystems.monitoring.business.vo.CoreRpcVO/
extent-class
class-ref=de.arvatosystems.monitoring.business.vo.server.ServerVO/
field-descriptor name=entryID column=ID jdbc-type=INTEGER
primarykey=true/
field-descriptor name=locale column=LOCALE
jdbc-type=VARCHAR/
field-descriptor name=Alias column=ALIAS jdbc-type=VARCHAR/
field-descriptor name=Description column=DESCRIPTION
jdbc-type=VARCHAR/
field-descriptor name=Active column=ACTIVE jdbc-type=INTEGER

conversion=org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFie
ldCo
nversion/
field-descriptor name=Monitor column=MONITOR
jdbc-type=INTEGER

conversion=org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFie
ldCo
nversion/
/class-descriptor

Hope this helps.

Julia.

-Ursprüngliche Nachricht-
Von: Armin Waibel [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 26. Juni 2003 09:34
An: OJB Users List
Betreff: Re: web app in jboss -- where to put files?


Hi again,

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

ok, but

 Caused by: org.apache.ojb.broker.metadata.MetadataException: Error
creating
 PersistentField: de.arvatosystems.monitoring.business.vo.CoreVO,
entryID
 at
org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
 at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
 at

indicate that something while parsing the repository file,
in particular CoreVO, is going wrong.
Could you post your repository_user.xml or a snip
showing mapping for CoreVO?

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 9:23 AM
Subject: AW: web app in jboss -- where to put files?


 Hi Armin,

 as I posted before, I think he finds the file or how could he then
know
 about the class CoreVO?

 The file is not corrupted. I validated it against the dtd with XML Spy
and
 that works fine!

 What do you mean by this:
  Or OJB can not instantiate PersistentField object for 'entryID'.

 The stack trace doesn't say very much but I can post it again.

 Thanks, Julia.




 *
 java.lang.ExceptionInInitializerError
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa
ultK
 ey(Unknown Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.init(Un
know
 n Source)
 at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
 Method)
 at

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
cces
 sorImpl.java:39)
 at

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
truc
 torAccessorImpl.java:27)
 at
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
 at java.lang.Class.newInstance0(Class.java:306)
 at java.lang.Class.newInstance(Class.java:259)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
 Source)
 at

org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.clinit(Unkn
own
 Source)
 at
 org.apache.ojb.broker.PersistenceBrokerFactory.getConfigurator(Unknown
 Source)
 at org.apache.ojb.odmg.OJBJ2EE_2.getInstance(Unknown Source)
 at org.apache.ojb.jboss.ODMGFactory.getInstance(Unknown
Source)
 at

de.arvatosystems.monitoring.business.scheduler.InitServlet.init(InitServ
let.
 java:180)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)
 at
 org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:219)
 at

org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandl
er.j
 

Re: java.lang.StackOverflowError within ODMG

2003-06-26 Thread Peter Gaus
Hi Thomas,

Thanks for your fast response and your advice.
Our problem is solved.

I have only two further questions:

1) Why does OJB a connection loss with the throw of an
StackOverflowError
   (even if we you the validationQuery),
   couldn't there be another exception?

2) Does an addtitional attribute exist in the OJB-config xml files,
   that say OJB to do an dummy-query e.g. every 6 hours?
   Because it seems that mysql closes the connection if it's idle for a
longer time.

Thanks
Peter



-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 26. Juni 2003 08:10
An: OJB Users List
Betreff: Re: java.lang.StackOverflowError within ODMG


you should use the validationQuery attribute on the jdbc-connection 
descriptor. the validation query will be executed to check if a 
connection is still alive before using a connection.

cheers,
Thomas

Peter Gaus wrote:
 Hi all,
 
 we are using ODMG and have a strange problem:
 
 When we start our application it opens following database-connection:
 
 * CODE **
  Database db   = implementation.newDatabase(); db.open( jcdAlias, 
 Database.OPEN_READ_WRITE );
 * CODE **
 
 * LOG ** 
 [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=org.gjt.mm.mysql.Driver
  protocol=jdbc
  sub-protocol=mysql
  db-alias=//***/***
  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_FALSE
  ignoreAutoCommitExceptions=false
  
 [EMAIL PROTECTED]
 1dc3d[
 
 sequenceManagerClass=class
 org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
 Properties={autoNaming=true, globalSequenceId=false, 
 globalSequenceStart=1, grabSize=1}
 ]
 ]
 * LOG **
 
 We use this db reference in our whole application, the database will
 never be closed.
 So far everything works great.
 
 But after some idle hours (typicly over night, when nobody uses our
 server) following problem occurs. Within an OQL query we get following

 exception- trace:
 * StackTrace **
 see the attached file
 * StackTrace **
 
 Should we close the connection in beetween, or what is wrong?
 
 Thanks for your help,
 
 Peter Gaus
 
 
 --
 --
 
 java.lang.StackOverflowError
   at java.net.SocketOutputStream.socketWrite0(Native Method)
   at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
   at
java.net.SocketOutputStream.write(SocketOutputStream.java:136)
   at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
   at
java.io.BufferedOutputStream.write(BufferedOutputStream.java:113)
   at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:1477)
   at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:1405)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:879)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
   at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:917)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1841)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1787)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1768)
   at
com.mysql.jdbc.Connection.rollbackNoChecks(Connection.java:1369)
   at com.mysql.jdbc.Connection.rollback(Connection.java:1356)
   at com.mysql.jdbc.Connection.close(Connection.java:1028)
   at com.mysql.jdbc.Connection.cleanup(Connection.java:2050)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1853)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1787)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1768)
   at
com.mysql.jdbc.Connection.rollbackNoChecks(Connection.java:1369)
   at com.mysql.jdbc.Connection.rollback(Connection.java:1356)
   at com.mysql.jdbc.Connection.close(Connection.java:1028)
   at com.mysql.jdbc.Connection.cleanup(Connection.java:2050)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1853)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1787)
   at com.mysql.jdbc.Connection.execSQL(Connection.java:1768)
 
 
 
 ca. 150 times this lines


***
   at
com.mysql.jdbc.Connection.rollbackNoChecks(Connection.java:1369)
   at com.mysql.jdbc.Connection.rollback(Connection.java:1356)
   at 

Need Direction or Instruction

2003-06-26 Thread [EMAIL PROTECTED]
Can anyone show me how to deploy db-ojb-1.0.rc3.tgz on windows tomcat4.1.4?
I was using the previous version and didn't notice this latest version.

Thanks in advance.

Wai Kit.


mail2web - Check your email from the web at
http://mail2web.com/ .



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



RE: mapping

2003-06-26 Thread oliver . matz
Hello,

 -Original Message-
 From: Joerg Lensing [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 26, 2003 10:12 AM
 To: OJB Users List
 Subject: mapping 
 
 
 hello,
 i have to map several fields which can have a limited number 
 of values. 
 e.g. day of week = mon,tue, wed. Because of
 performance I don't want to store them as Strings. Integers 
 would be my 
 favorit datatype. But then i have

or maybe BYTE?

 to lookup for the meaning or the integers in my javacode. This is 
 something, i don't like.
 
 Any hints? Does OJB support a machanism for this?
 
 joerg

we have the same situation.
We use the type-safe enum pattern in our application,
i.e., a class DayOfWeek with a private constructor
and seven static fields of type DayOfWeek, namely MONDAY,
TUESDAY and so on.

Then we implement a class 
DayOfWeekToIntConversion implements 
org.apache.ojb.broker.accesslayer.conversions.FieldConversion

and declare that FieldConversion in the corresponding 
field-descriptor in repository_user.xml.

HTH,
Olli




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



Re: mapping

2003-06-26 Thread Joerg Lensing
[EMAIL PROTECTED] schrieb:

or maybe BYTE?
 

yes, this would be ok took,

we have the same situation.
We use the type-safe enum pattern in our application,
i.e., a class DayOfWeek with a private constructor
and seven static fields of type DayOfWeek, namely MONDAY,
TUESDAY and so on.
Then we implement a class 
DayOfWeekToIntConversion implements 
org.apache.ojb.broker.accesslayer.conversions.FieldConversion
 

i thought about this too, but i have several types like this and i would 
have to
write a conversion class for each type.

joerg

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


Am I missing something for the update

2003-06-26 Thread cmarcourt
Hi,

update works perfectly well in my application for small modification, says only one 
setter.
Now I've got a big big form (it's an eight step form). I stored its values in a 
session during all the time.
I trace the value for a specific field, this value is right to the end.
But when I call the store() method, it's just like these field are not updated in the 
database.
Here is the java source with the trace.

Say I set the adult capacity to 20.

private void update() {
Collection c = null;
java.util.Iterator it = null;
PersistenceBroker broker = null;
com.hbk.bean.House house = (com.hbk.bean.House) 
super.session.getAttribute(Constant.SESSION_HOUSE);
MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult 
capacity 1 :  + house.getAdultCapacity()); // print 20

if (house!=null) {
try {
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
broker.clearCache();

this.processFinalForm(house);

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 2 
:  + house.getAdultCapacity()); // print 20
house.setModificationDate(new java.util.Date());

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 3 
:  + house.getAdultCapacity()); // print 20

Criteria criteria = new Criteria();
criteria.addEqualTo(id, new Integer(house.getId()));

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 4 
:  + house.getAdultCapacity()); // print 20
QueryByCriteria query = new QueryByCriteria(com.hbk.bean.House.class, 
criteria);

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 5 
:  + house.getAdultCapacity()); // print 20

broker.beginTransaction();

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 6 
:  + house.getAdultCapacity()); // print 20

com.hbk.bean.House toBeEdited = (com.hbk.bean.House) 
broker.getObjectByQuery(query);

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 7 
:  + house.getAdultCapacity()); // print 20

toBeEdited.setAdultCapacity(house.getAdultCapacity());

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 8 
:  + house.getAdultCapacity()); // print 20

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 9 
:  + toBeEdited.getAdultCapacity()); // print 20 (notice the toBeEdited and not the 
house object, I know it's stupid, but I can't believe it )
toBeEdited.setChildCapacity(house.getChildCapacity());
toBeEdited.setCity(house.getCity());
toBeEdited.setCountry(house.getCountry());
toBeEdited.setDisplay(house.isDisplay());
toBeEdited.setDistrict(house.getDistrict());
toBeEdited.setHistoricals(house.getHistoricals());
toBeEdited.setInteriorDescriptions(house.getInteriorDescriptions());
toBeEdited.setInventory(house.getInventory());
toBeEdited.setModificationDate(house.getModificationDate());
toBeEdited.setName(house.getName());
toBeEdited.setNewProduct(house.isNewProduct());
toBeEdited.setOutsideDescriptions(house.getOutsideDescriptions());
//toBeEdited.setOwner(house.getOwner());
//toBeEdited.setPhotos(house.getPhotos());
toBeEdited.setReference(house.getReference());
//toBeEdited.setRooms(house.getRooms());
toBeEdited.setSellPrice(house.getSellPrice());
//toBeEdited.setServices(house.getServices());
toBeEdited.setStreet1(house.getStreet1());
toBeEdited.setStreet2(house.getStreet2());
toBeEdited.setStreet3(house.getStreet3());
toBeEdited.setSurface(house.getSurface());
toBeEdited.setType(house.getType());
toBeEdited.setZipCode(house.getZipCode());

broker.store(toBeEdited);
broker.commitTransaction();

this.processPhotoFile(house);
} catch (org.apache.ojb.broker.PersistenceBrokerException pbe) {

MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).fatal(pbe);
} finally {
broker.clearCache();
broker.close();
}
}
}

Do you see a strange thing in my code ?

Christophe


RE: mapping

2003-06-26 Thread oliver . matz
Hello,

 -Original Message-
 From: Joerg Lensing [mailto:[EMAIL PROTECTED]

 We use the type-safe enum pattern in our application,

 
 Then we implement a class 
 DayOfWeekToIntConversion implements 
 org.apache.ojb.broker.accesslayer.conversions.FieldConversion
   
 
 i thought about this too, but i have several types like this 
 and i would 
 have to
 write a conversion class for each type.

Same with us.  We use code generation to do so.

You could, alternatively, let all your type-safe-enum classes
implement a common interface (with two methods getAsInt() and 
a getForInt()) and write one common FieldConversion for these.

Olli

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



Re: Am I missing something for the update

2003-06-26 Thread cmarcourt
I found my mistake.
I forgot to set the Id to force an update of the object.

Christophe

 Message du 26/06/03 10:49
 De : cmarcourt [EMAIL PROTECTED]
 A : [EMAIL PROTECTED]
 Copie à : 
 Objet : Am I missing something for the update
 Hi,
 
 update works perfectly well in my application for small modification, says only one 
 setter.
 Now I've got a big big form (it's an eight step form). I stored its values in a 
 session during all the time.
 I trace the value for a specific field, this value is right to the end.
 But when I call the store() method, it's just like these field are not updated in 
 the database.
 Here is the java source with the trace.
 
 Say I set the adult capacity to 20.
 
 private void update() {
 Collection c = null;
 java.util.Iterator it = null;
 PersistenceBroker broker = null;
 com.hbk.bean.House house = (com.hbk.bean.House) 
 super.session.getAttribute(Constant.SESSION_HOUSE);
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult 
 capacity 1 :  + house.getAdultCapacity()); // print 20
 
 if (house!=null) {
 try {
 broker = PersistenceBrokerFactory.defaultPersistenceBroker();
 broker.clearCache();
 
 this.processFinalForm(house);
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 2 :  + house.getAdultCapacity()); // print 20
 house.setModificationDate(new java.util.Date());
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 3 :  + house.getAdultCapacity()); // print 20
 
 Criteria criteria = new Criteria();
 criteria.addEqualTo(id, new Integer(house.getId()));
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 4 :  + house.getAdultCapacity()); // print 20
 QueryByCriteria query = new 
 QueryByCriteria(com.hbk.bean.House.class, criteria);
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 5 :  + house.getAdultCapacity()); // print 20
 
 broker.beginTransaction();
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 6 :  + house.getAdultCapacity()); // print 20
 
 com.hbk.bean.House toBeEdited = (com.hbk.bean.House) 
 broker.getObjectByQuery(query);
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 7 :  + house.getAdultCapacity()); // print 20
 
 toBeEdited.setAdultCapacity(house.getAdultCapacity());
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 8 :  + house.getAdultCapacity()); // print 20
 
 MandarinoLogger.getInstance(Constant.HOUSEBOOKING_LOGGER_NAME).debug(adult capacity 
 9 :  + toBeEdited.getAdultCapacity()); // print 20 (notice the toBeEdited and not 
 the house object, I know it's stupid, but I can't believe it )
 toBeEdited.setChildCapacity(house.getChildCapacity());
 toBeEdited.setCity(house.getCity());
 toBeEdited.setCountry(house.getCountry());
 toBeEdited.setDisplay(house.isDisplay());
 toBeEdited.setDistrict(house.getDistrict());
 toBeEdited.setHistoricals(house.getHistoricals());
 toBeEdited.setInteriorDescriptions(house.getInteriorDescriptions());
 toBeEdited.setInventory(house.getInventory());
 toBeEdited.setModificationDate(house.getModificationDate());
 toBeEdited.setName(house.getName());
 toBeEdited.setNewProduct(house.isNewProduct());
 toBeEdited.setOutsideDescriptions(house.getOutsideDescriptions());
 //toBeEdited.setOwner(house.getOwner());
 //toBeEdited.setPhotos(house.getPhotos());
 toBeEdited.setReference(house.getReference());
 //toBeEdited.setRooms(house.getRooms());
 toBeEdited.setSellPrice(house.getSellPrice());
 //toBeEdited.setServices(house.getServices());
 toBeEdited.setStreet1(house.getStreet1());
 toBeEdited.setStreet2(house.getStreet2());
 toBeEdited.setStreet3(house.getStreet3());
 toBeEdited.setSurface(house.getSurface());
 toBeEdited.setType(house.getType());
 toBeEdited.setZipCode(house.getZipCode());
 
 broker.store(toBeEdited);
 broker.commitTransaction();
 
 this.processPhotoFile(house);
 

RE: attribute element in field-desciptor

2003-06-26 Thread Mahler Thomas
hi Joerg,

http://db.apache.org/ojb/repository.html#attribute for reference.
You can use this tag for user defined attrbites that you want to add to your
field-, reference, collection and class-decsriptors.
This allows you to keep special information within the DescriptorRepository.

For instance you could keep a jcdAlias Attribute with each class-descriptor
and use this value to store classes to different jdbc datasources.

http://cvs.apache.org/viewcvs/db-ojb/src/test/org/apache/ojb/broker/metadata
/CustomAttributesTest.java

shows how to use the API (and also proves that this feature is working!)

cheers,
Thomas

 -Original Message-
 From: Joerg Lensing [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 26, 2003 10:56 AM
 To: OJB Users List
 Subject: attribute element in field-desciptor
 
 
 hello,
 can someone tell me the purpose of the attribute element in 
 field-descriptor? the docs are very
 short about this and the testcases don't show an example.
 
 joerg
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


Re: attribute element in field-desciptor

2003-06-26 Thread Ron Gallagher
Joerg --

The attribute element allows you to add any sort of attribute without having to first 
modify the dtd.  They allow users to implement enhancements that shouldn't be part of 
the core ojb api.  I use them extensively on my current project to allow me to use 
Oracle packages to handle all insert, update and delete operations.  Details of how 
we're doing this can be found 
xdocs/how-to-work-with-stored-procedures.xml.

Ron Gallagher
Atlanta, GA
[EMAIL PROTECTED]


 
 From: Joerg Lensing [EMAIL PROTECTED]
 Date: 2003/06/26 Thu AM 04:56:10 EDT
 To: OJB Users List [EMAIL PROTECTED]
 Subject: attribute element in field-desciptor
 
 hello,
 can someone tell me the purpose of the attribute element in 
 field-descriptor? the docs are very
 short about this and the testcases don't show an example.
 
 joerg
 
 
 -
 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]



unable to get transaction in JBoss

2003-06-26 Thread Julia . Winkler
Hello,

I'm using JBoss 3.0.6 and I have a web application running that uses OJB
rc3. I'm trying to insert an object but I'm not able to get the current
transaction:

Transaction tx = odmg.currentTransaction(); /* here I get the crash */
tx.lock(object, Transaction.WRITE);
tx.commit();

The ODMG implemantation is instantiated as follows (I didn't wanted to use
ODMGFactory because needed JBoss specific Jar-Files):

ODMGJ2EEFactory factory = null;
try
{
  factory = (ODMGJ2EEFactory) context.lookup(java:/ojb/defaultODMG);
}
catch (NamingException e)
{
  logger.error(THIS_CLASS + ctx.lookup(java:/ojb/defaultODMG) failed, e);
  throw new OJBRuntimeException(Could not lookup ODMG factory instance,
e);
}
this.odmg = factory.getInstance();

What am I doing wrong?

Julia.


P.S.: The Stack Trace:

org.odmg.TransactionNotInProgressException: No external transaction found
at org.apache.ojb.odmg.JTATxManager.registerTx(Unknown Source)
at org.apache.ojb.odmg.TransactionImpl.begin(Unknown Source)
at org.apache.ojb.odmg.OJBJ2EE_2.beginInternTransaction(Unknown
Source)
at org.apache.ojb.odmg.OJBJ2EE_2.currentTransaction(Unknown Source)
at
de.arvatosystems.monitoring.integration.dao.server.ServerOjbDAO.insert(Serve
rOjbDAO.java:285)
at
de.arvatosystems.monitoring.business.delegate.ServerDelegate.insert(ServerDe
legate.java:191)
at
de.arvatosystems.monitoring.presentation.action.server.CollectModule.execute
(CollectModule.java:255)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:465)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandl
er.java:280)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:553)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1717)
at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext
.java:549)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1667)
at org.mortbay.http.HttpServer.service(HttpServer.java:862)
at org.jboss.jetty.Jetty.service(Jetty.java:497)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:759)
at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:923)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:776)
at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:202)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)

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



Latest CVS (rc4?), collection-class no longer work as defined in DTD

2003-06-26 Thread Edson Carlos Ericksson Richter

Hi! In my M:N testing work, I've discovered that class-descriptor now works
ONLY for ManageableCollections now.
This problem is caused by

private ManageableCollection getCollectionByQuery(Class collectionClass,
Class itemClass, Query query)
  ...
result = (ManageableCollection) collectionClass.newInstance();
 ...

in PersistenceBrokerImpl (1312).

Should not this piece of code be returning a Collection? See DTD:

 The collection-class may hold a fully qualified class name.
 This class must be the Java type of the Collection attribute.
 This attribute must only specified if the attribute type is not
 a java.util.Collection (or subclass) or Array type.

So, if we are forcing this to be a ManageableCollection, we are in trouble,
no?

Thanks for your attention.

Edson Richter



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/6/2003


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



RE: Getting the correct class instantiated

2003-06-26 Thread David . Corbin

Well, not really.  Your code looks like it's examining the database to find
the right ClassDescriptor, which I don't really need to do.  I'm looking
for a way to override readObjectFromRow, so that I can simply return an
object of the correct class.  All the different classes come from the same
table, so I want to have only one class descriptor.

David



|-+---
| |   Jim Shingler  |
| |   [EMAIL PROTECTED]|
| |   et |
| |   |
| |   06/25/2003 05:16|
| |   PM  |
| |   Please respond  |
| |   to OJB Users   |
| |   List   |
| |   |
|-+---
  
--|
  |
  |
  |To:  'OJB Users List' [EMAIL PROTECTED] 
 |
  |cc: 
  |
  |Subject: RE: Getting the correct class instantiated 
  |
  |
  |
  
--|



I do the same thing.


Below you will find a segment of my row reader below.


Table
ContactPoint
 ID
 TypeID
 EmailAddress
 PhoneNumber
 ...

ID   TypeIDEmailAddressPhoneNumber
11   [EMAIL PROTECTED]
22   NA
123-345.6789

Type Table
 ID
 classOf

ID   ClassOF
1sd.loc.Email
2sd.loc.PhoneNumber


Objects

ContactPoint
 |- sd.loc.PhoneNumber
 |- sd.loc.Email


Obvious disclaimers,  I haven't had this reviewed by the experts yet.
Maybe some experts can comment.



 ClassDescriptor cld = getClassDescriptor();
// check if there is an attribute which tells us which concrete
class is to be instantiated
//FieldDescriptor concreteClassFD =
cld.getFieldDescriptorByName(ClassDescriptor.OJB_CONCRETE_CLASS);
FieldDescriptor concreteClassFD =
cld.getFieldDescriptorByName(classOf);
 FieldDescriptor concreteClassFD2 =
cld.getFieldDescriptorByName(typeID);
 ClassDescriptor result = null;




// JLS IDEA:
// IF ClassOf isnt present check for TypeID and Load the underlying
TypeClass to get the ClassOF
// TypeID should be the preferred method


if (concreteClassFD == null  concreteClassFD2 == null)
return cld;

if (concreteClassFD2 != null)
{
   // Load the Type and pull classof off it
   Type typeQuery = new Type();
   typeQuery.setObjID((String)
row.get(concreteClassFD2.getColumnName()));
 Query query = new
QueryByCriteria(typeQuery);
 //uery.
 Type type = null;
 String concreteClass = null;


 PersistenceBroker broker = null;
 try
 {

 broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
 //broker.beginTransaction
();
 Object o =
broker.getObjectByQuery(query);
 type =
(Type)ProxyHelper.getRealObject(o);
 //broker.commitTransaction
();
 concreteClass =
type.getClassOf();
 if (concreteClass == null
||
concreteClass.trim().length() == 0)
 {
 throw new
PersistenceBrokerException(

   type.classOf
field returned null or 0-length string);
 }
 else
   

Re: unable to get transaction in JBoss

2003-06-26 Thread Armin Waibel
Hi,

in your configuration OJB needs a JTA transaction
to synchronize with this a internal tx.
Try to use UserTransaction

UserTransaction utx = lookup..
utx.begin()
 Transaction tx = odmg.currentTransaction(); /* here I get the crash */
 tx.lock(object, Transaction.WRITE);
utx.commit();

or enable container managed transaction demarcation.

regards,
Armin

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 2:42 PM
Subject: unable to get transaction in JBoss


 Hello,

 I'm using JBoss 3.0.6 and I have a web application running that uses
OJB
 rc3. I'm trying to insert an object but I'm not able to get the
current
 transaction:

 Transaction tx = odmg.currentTransaction(); /* here I get the crash */
 tx.lock(object, Transaction.WRITE);
 tx.commit();

 The ODMG implemantation is instantiated as follows (I didn't wanted to
use
 ODMGFactory because needed JBoss specific Jar-Files):

 ODMGJ2EEFactory factory = null;
 try
 {
   factory = (ODMGJ2EEFactory) context.lookup(java:/ojb/defaultODMG);
 }
 catch (NamingException e)
 {
   logger.error(THIS_CLASS + ctx.lookup(java:/ojb/defaultODMG)
failed, e);
   throw new OJBRuntimeException(Could not lookup ODMG factory
instance,
 e);
 }
 this.odmg = factory.getInstance();

 What am I doing wrong?

 Julia.


 P.S.: The Stack Trace:

 org.odmg.TransactionNotInProgressException: No external transaction
found
 at org.apache.ojb.odmg.JTATxManager.registerTx(Unknown Source)
 at org.apache.ojb.odmg.TransactionImpl.begin(Unknown Source)
 at
org.apache.ojb.odmg.OJBJ2EE_2.beginInternTransaction(Unknown
 Source)
 at org.apache.ojb.odmg.OJBJ2EE_2.currentTransaction(Unknown
Source)
 at

de.arvatosystems.monitoring.integration.dao.server.ServerOjbDAO.insert(S
erve
 rOjbDAO.java:285)
 at

de.arvatosystems.monitoring.business.delegate.ServerDelegate.insert(Serv
erDe
 legate.java:191)
 at

de.arvatosystems.monitoring.presentation.action.server.CollectModule.exe
cute
 (CollectModule.java:255)
 at

org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
oces
 sor.java:465)
 at

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
 at

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422)
 at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523)
 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
 at

org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationH
andl
 er.java:280)
 at

org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:553)
 at org.mortbay.http.HttpContext.handle(HttpContext.java:1717)
 at

org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationCon
text
 .java:549)
 at org.mortbay.http.HttpContext.handle(HttpContext.java:1667)
 at org.mortbay.http.HttpServer.service(HttpServer.java:862)
 at org.jboss.jetty.Jetty.service(Jetty.java:497)
 at
org.mortbay.http.HttpConnection.service(HttpConnection.java:759)
 at
 org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:923)
 at
org.mortbay.http.HttpConnection.handle(HttpConnection.java:776)
 at

org.mortbay.http.SocketListener.handleConnection(SocketListener.java:202
)
 at
org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
 at
org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)

 -
 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]



ODMG update bug moving from rc3 to rc4 (CVS HEAD)

2003-06-26 Thread Weaver, Scott
In ODMG, I have a 1:1 relationship between object A and object B.  I retrieve object A 
using PB.  I proceed to make a change to object B that was materialized along with 
object A.  I then pass object A to a method that contains the code below, update(A).  
In rc3 object B's changes were made persistent to the RDBMS however in the current CVS 
HEAD, they are not.



public void update(Object object)
{
pb = getBroker();
// 1. remove object from the OJB cache
pb.removeFromCache(object);

// 2. Start the transaction
Transaction tx = odmg.newTransaction();
tx.begin();

// 3. retreive a stale version of this object from the db
Identity id = new Identity(object, pb);
Object staleObject = pb.getObjectByIdentity(id);
tx.lock(staleObject, Transaction.WRITE); 

// 4. Map new values to the stale object
BeanUtils.copyProperties(staleObject, object);

// 5. Commit the transaction
tx.commit();
}


  









*===*
* Scott T Weaver    *
* Jakarta Jetspeed Portal Project   *
* [EMAIL PROTECTED] *
*===*
  




RE: mapping

2003-06-26 Thread Lance Eason
Check out the FieldConversion interface.  You can define your own FieldConversion that 
takes the Java representation (a String) and turns it into the database representation 
(a number) when rows are saved and does the reverse when they're read in.  You then 
just register that FieldConversion using the field-descriptor's 'conversion' attribute 
for the appropriate fields.

-Original Message-
From: Joerg Lensing [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 3:12 AM
To: OJB Users List
Subject: mapping 


hello,
i have to map several fields which can have a limited number of values. 
e.g. day of week = mon,tue, wed. Because of
performance I don't want to store them as Strings. Integers would be my 
favorit datatype. But then i have
to lookup for the meaning or the integers in my javacode. This is 
something, i don't like.

Any hints? Does OJB support a machanism for this?

joerg



-
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: mapping

2003-06-26 Thread Joerg Lensing
hello lance and oliver,

you convinced me :-)

joerg



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


SOLUTION for M:N never delete or always delete, no matter auto-delete=true or auto-delete=false

2003-06-26 Thread Edson Carlos Ericksson Richter
(this is a real long mail, but I've made a long research. The first part is
the reason I started to research, the second is explain why this occur. The
third is a suggestion of how can we correct).

FIRST PART:
Ok. To avoid the problem related to OJB always using RemovalAwareCollection,
I put my beans to work as

public class A {
  private ArrayList myColl = new ArrayList();

  public void setMyCollection( List collection ) { this.myColl.clear;
this.myColl.addAll( collection ); }
  public List getMyCollection( ) {return this.myColl;}
}

Doing this, I'm converting from RemovalAwareCollection to ArrayList. Fine.

Now suppose that I want auto-delete=true. Then I

getMyCollection().remove(0);

and then persist the object. Theorically, OJB should delete the object from
indirection table AND the referenced table (the N side, ok?). This not
occur. OJB deletes only from indirection table (the auto-delete option makes
no difference).

If I change the code to

public class A {
  private List myColl;

  public void setMyCollection( List collection ) { this.myColl=collection; }
  public List getMyCollection( ) {return this.myColl;}
}

then it works (because the collection passed to setter is
RemovalAwareCollection). BUT, if I put auto-delete=false, then OJB still
delete the indirection table AND the referenced table (again, the
auto-delete option makes no difference).

SECOND PART:
To the facts: since OJB is using RemovalAwareCollection, after the correct
treatment for M:N non-decomposable queries (that my debugging show that it
is working like a charm), the following code is being executed:

// invoke callback on collection
if (col instanceof ManageableCollection)
{
((ManageableCollection) col).afterStore(this);
}

That is deleting the real objects, even if auto-delete=false.

THIRD PART:
The method deleteMtoNImplementor(...) should reset the
allObjectsToBeRemoved in RemovalAwareCollection if the auto-delete option
is set to false. What do you think? Something like create a RemovalAware
interface. Make all classes (RemovalAwareCollection, and RemovalAwareList in
my case) implement it. Then do

public interface RemovalAware {

  public void resetDeleted();
}

The resetDelete method implementation is just

public void resetDeleted( ) {
  allObjectsToBeRemoved.clear();
}


and then change PersistentBrokerImpl to

currentMtoNKeys = getMtoNImplementor(cds, obj);
// delete unused m:n implementors
deleteMtoNImplementor(cds, obj, (Collection)col,
currentMtoNKeys);

if( col instanceof ManageableCollection 
!cds.getCascadeDelete() ) {
  Collection testCol;
  if( col instanceof CollectionProxy ) {
testCol = ( ( CollectionProxy )col ).getData();
  } else {
testCol = ( Collection )col;
  }

  if( testCol instanceof RemovalAware ) {
( ( RemovalAware )testCol ).resetDeleted();
  }
}

This make M:N suff work working. I'm using CVS HEAD.

Thanks for your patience.

Edson Richter




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/6/2003


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



Re: web app in jboss -- where to put files?

2003-06-26 Thread kraemer
On Thu, Jun 26, 2003 at 10:05:04AM +0200, [EMAIL PROTECTED] wrote:
 Hello Armin,
 
 I'm getting behind the problems!! But still I think it is strange! I wasn't
 strict enough with my naming conventions. Some class attributes started with
 a capital letter. Also it matched my speeling min the repository file, OJB
 wasn't able the create the persistent filed. This seems to be a must that no
 attribute shoul start with a capital letter.

Just guessing:
If you use PersistentFieldPropertyImpl (do you?) as PersistentFieldClass 
(declared in OJB.properties), your member variables have to comply with
the JavaBeans specification, which imho says that attribute names have
to start with a lower case letter.

Maybe that's an explanation for OJB's behaviour ?

Jens

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



RE: Getting the correct class instantiated

2003-06-26 Thread Jim Shingler


How about this,

Take a look at the method

   protected ClassDescriptor selectClassDescriptor(Map row) throws
PersistenceBrokerException

The row is basically a resultset that you of the table.  Just pull your
column that represents the correct class type and used that to indicate
which object to build using the repository.xml
   

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 26, 2003 8:52 AM
To: OJB Users List
Cc: 'OJB Users List'
Subject: RE: Getting the correct class instantiated



Well, not really.  Your code looks like it's examining the database to
find the right ClassDescriptor, which I don't really need to do.  I'm
looking for a way to override readObjectFromRow, so that I can simply
return an object of the correct class.  All the different classes come
from the same table, so I want to have only one class descriptor.

David



|-+---
| |   Jim Shingler  |
| |   [EMAIL PROTECTED]|
| |   et |
| |   |
| |   06/25/2003 05:16|
| |   PM  |
| |   Please respond  |
| |   to OJB Users   |
| |   List   |
| |   |
|-+---
 
---

---|
  |
|
  |To:  'OJB Users List' [EMAIL PROTECTED]
|
  |cc:
|
  |Subject: RE: Getting the correct class instantiated
|
  |
|
 
---

---|



I do the same thing.


Below you will find a segment of my row reader below.


Table
ContactPoint
 ID
 TypeID
 EmailAddress
 PhoneNumber
 ...

ID   TypeIDEmailAddressPhoneNumber
11   [EMAIL PROTECTED]
22   NA
123-345.6789

Type Table
 ID
 classOf

ID   ClassOF
1sd.loc.Email
2sd.loc.PhoneNumber


Objects

ContactPoint
 |- sd.loc.PhoneNumber
 |- sd.loc.Email


Obvious disclaimers,  I haven't had this reviewed by the experts yet.
Maybe some experts can comment.



 ClassDescriptor cld = getClassDescriptor();
// check if there is an attribute which tells us which concrete
class is to be instantiated
//FieldDescriptor concreteClassFD =
cld.getFieldDescriptorByName(ClassDescriptor.OJB_CONCRETE_CLASS);
FieldDescriptor concreteClassFD =
cld.getFieldDescriptorByName(classOf);
 FieldDescriptor concreteClassFD2 =
cld.getFieldDescriptorByName(typeID);
 ClassDescriptor result = null;




// JLS IDEA:
// IF ClassOf isnt present check for TypeID and Load the underlying
TypeClass to get the ClassOF // TypeID should be the preferred method


if (concreteClassFD == null  concreteClassFD2 == null)
return cld;

if (concreteClassFD2 != null)
{
   // Load the Type and pull classof off it
   Type typeQuery = new Type();
   typeQuery.setObjID((String)
row.get(concreteClassFD2.getColumnName()));
 Query query = new
QueryByCriteria(typeQuery);
 //uery.
 Type type = null;
 String concreteClass = null;


 PersistenceBroker broker = null;
 try
 {

 broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
 
//broker.beginTransaction ();
 Object o =
broker.getObjectByQuery(query);
 type =
(Type)ProxyHelper.getRealObject(o);
 
//broker.commitTransaction ();
 concreteClass =
type.getClassOf();
 if (concreteClass ==
null
||
concreteClass.trim().length() == 0)
 {
 throw new
PersistenceBrokerException(

   type.classOf
field returned null or 0-length string);
 }
 else
 {
 
concreteClass = concreteClass.trim();
 }
  

RE: Getting the correct class instantiated

2003-06-26 Thread David . Corbin

AH... That was the context I was missing for your example to make sense to
me...



|-+---
| |   Jim Shingler  |
| |   [EMAIL PROTECTED]|
| |   et |
| |   |
| |   06/26/2003 01:26|
| |   PM  |
| |   Please respond  |
| |   to OJB Users   |
| |   List   |
| |   |
|-+---
  
--|
  |
  |
  |To:  'OJB Users List' [EMAIL PROTECTED] 
 |
  |cc: 
  |
  |Subject: RE: Getting the correct class instantiated 
  |
  |
  |
  
--|





How about this,

Take a look at the method

   protected ClassDescriptor selectClassDescriptor(Map row) throws
PersistenceBrokerException

The row is basically a resultset that you of the table.  Just pull your
column that represents the correct class type and used that to indicate
which object to build using the repository.xml


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 8:52 AM
To: OJB Users List
Cc: 'OJB Users List'
Subject: RE: Getting the correct class instantiated



Well, not really.  Your code looks like it's examining the database to
find the right ClassDescriptor, which I don't really need to do.  I'm
looking for a way to override readObjectFromRow, so that I can simply
return an object of the correct class.  All the different classes come
from the same table, so I want to have only one class descriptor.

David



|-+---
| |   Jim Shingler  |
| |   [EMAIL PROTECTED]|
| |   et |
| |   |
| |   06/25/2003 05:16|
| |   PM  |
| |   Please respond  |
| |   to OJB Users   |
| |   List   |
| |   |
|-+---

---

---|
  |
|
  |To:  'OJB Users List' [EMAIL PROTECTED]
|
  |cc:
|
  |Subject: RE: Getting the correct class instantiated
|
  |
|

---

---|



I do the same thing.


Below you will find a segment of my row reader below.


Table
ContactPoint
 ID
 TypeID
 EmailAddress
 PhoneNumber
 ...

ID   TypeIDEmailAddressPhoneNumber
11   [EMAIL PROTECTED]
22   NA
123-345.6789

Type Table
 ID
 classOf

ID   ClassOF
1sd.loc.Email
2sd.loc.PhoneNumber


Objects

ContactPoint
 |- sd.loc.PhoneNumber
 |- sd.loc.Email


Obvious disclaimers,  I haven't had this reviewed by the experts yet.
Maybe some experts can comment.



 ClassDescriptor cld = getClassDescriptor();
// check if there is an attribute which tells us which concrete
class is to be instantiated
//FieldDescriptor concreteClassFD =
cld.getFieldDescriptorByName(ClassDescriptor.OJB_CONCRETE_CLASS);
FieldDescriptor concreteClassFD =
cld.getFieldDescriptorByName(classOf);
 FieldDescriptor concreteClassFD2 =
cld.getFieldDescriptorByName(typeID);
 ClassDescriptor result = null;




// JLS IDEA:
// IF ClassOf isnt present check for TypeID and Load the underlying
TypeClass to get the ClassOF // TypeID should be the preferred method


if (concreteClassFD == null  concreteClassFD2 == null)
return cld;

if (concreteClassFD2 != null)
{
   // Load the Type and pull classof 

Re: Sap DB

2003-06-26 Thread Jakob Braeuchi
hi,

and now i should guess which one ?

jakob

Kwok Peng Tuck wrote:

I get a sql exception when trying to run bin\build junit.
I'm using version 7.3 of  sapdb. Did you ask the driver to us oracle 
mode ?

Jakob Braeuchi wrote:

hi,

i use sapdb to run the testcases.
btw what's the problem ?
jakob

Kwok Peng Tuck wrote:

Did anyone get past 'bin\build junit' with sapdb ? Seems that there 
is something wrong with the sql generated.

-
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: Getting the correct class instantiated

2003-06-26 Thread sclark
David,

Here is the RowReader that I use for this.  It's an abstract class; a subclass
to handle a specific table would have code like this:

protected String getDiscriminatorColumn() {
return KeyColumn;
}

protected Map getClassMappings() {
if (sClassMap == null) {
sClassMap = new HashMap();
sClassMap.put(KeyValue1, Class1.class);
sClassMap.put(KeyValue2, Class2.class);
}
return sClassMap;
}


Here's the superclass:

package gov.doi.tat.ojb.readers;

import java.util.HashMap;
import java.util.Map;

import org.apache.ojb.broker.PersistenceBroker;
import org.apache.ojb.broker.PersistenceBrokerException;
import org.apache.ojb.broker.PersistenceBrokerFactory;
import org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl;
import org.apache.ojb.broker.metadata.ClassDescriptor;
import org.apache.ojb.broker.metadata.FieldDescriptor;

/**
 * This class implements an OJB RowReader which can be used to read
 * objects from a table to which multiple classes have been mapped, with
 * String values in a designated column being used to indicate the
 * particular class to be instantiated.  The class is abstract; a subclass
 * must provide information about the mapping column and its values.
 *
 * @author a href=mailto:[EMAIL PROTECTED]Steve Clark/a
 */
public abstract class KeyColumnClassMappingRowReader
extends RowReaderDefaultImpl
{
/** Column containing site type key */
private String sKeyColumn = null;

/** Mappings from sKeyColumn values to Classes */
private static Map sClassMap = null;


public KeyColumnClassMappingRowReader(ClassDescriptor cld) {
super(cld);
sKeyColumn = getDiscriminatorColumn();
sClassMap = getClassMappings();
}

/**
 * Return the name of the column used to discriminate between
 * different classes.
 */
protected abstract String getDiscriminatorColumn();

/**
 * Return the mappings from values of the discriminator column
 * to classes to instantiate.
 */
protected abstract Map getClassMappings();


protected ClassDescriptor selectClassDescriptor(Map row)
throws PersistenceBrokerException
{
String key = (String) row.get(sKeyColumn);
Class clazz = null;

if (key != null) {
clazz = (Class) sClassMap.get(key);
}
if (clazz == null) {
return getClassDescriptor();
}

PersistenceBroker broker = null;
try {
broker = PersistenceBrokerFactory.defaultPersistenceBroker();
ClassDescriptor result = broker.getClassDescriptor(clazz);
broker.close();
if (result == null) {
return getClassDescriptor();
}
else {
return result;
}
}
catch (PersistenceBrokerException e) {
broker.close();
throw e;
}
}
}

Hope this helps.

-steve

Steve Clark
Technology Applications Team
Natural Resources Research Center/USGS
[EMAIL PROTECTED]
(970)226-9291

List-Id: OJB Users List ojb-user.db.apache.org
Subject: RE: Getting the correct class instantiated
To: OJB Users List [EMAIL PROTECTED]
Cc: 'OJB Users List' [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
Date: Thu, 26 Jun 2003 08:51:30 -0400


Well, not really.  Your code looks like it's examining the database to find
the right ClassDescriptor, which I don't really need to do.  I'm looking
for a way to override readObjectFromRow, so that I can simply return an
object of the correct class.  All the different classes come from the same
table, so I want to have only one class descriptor.

David


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



optimistic locking and decomposed M:N relationships

2003-06-26 Thread Bonnie MacKellar
I am adding optimistic locking to my database, using integer version fields
in each table.
I notice that it does not seem to work with tables implementing M:N
relationships
(I am using the decomposed style). I get this error :
com.jnetdirect.jsql.w: Cannot insert the value NULL into column
'rowVersion', table 'ActiveBill.dbo.Custodian';

Custodian implements the M:N relationship between users and accounts.

Does this mean that I should omit the version fields in M:N relationship
tables?
How will locking be handled for such tables?

Here is the repository information for the tables in question :
!-- Definitions for User table --
   class-descriptor
  class=com.mobius.activebill.persistentobjects.User
  table=ActiveBillUser
   
  field-descriptor
 name=userID
 column=userID
 jdbc-type=INTEGER
 primarykey=true
 autoincrement=true
  /
  field-descriptor 
 name=rowVersion 
 column=rowVersion
 jdbc-type=INTEGER 
 locking=true
  /
   ... stuff omitted...
  collection-descriptor
  name=accounts
 
element-class-ref=com.mobius.activebill.persistentobjects.Account
  auto-retrieve=true
  auto-update=false
  indirection-table=Custodian

fk-pointing-to-this-class column=userID /
fk-pointing-to-element-class column=accountID /
/collection-descriptor 
   /class-descriptor
!-- Definitions for Account table --
   class-descriptor
  class=com.mobius.activebill.persistentobjects.Account
  table=Account
   
  field-descriptor
 name=accountID
 column=accountID
 jdbc-type=INTEGER
 primarykey=true
 autoincrement=true
  /
  field-descriptor 
 name=rowVersion 
 column=rowVersion
 jdbc-type=INTEGER 
 locking=true
  /
  field-descriptor
 name=accountNumber
 column=accountNumber
 jdbc-type=VARCHAR
  /
  field-descriptor
 name=customerID
 column=customerID
 jdbc-type=INTEGER
  /
  reference-descriptor
name=customer
class-ref=com.mobius.activebill.persistentobjects.Customer
proxy=true

foreignkey field-ref=customerID/
  /reference-descriptor
  collection-descriptor
name=users
element-class-ref=com.mobius.activebill.persistentobjects.User
auto-retrieve=true
auto-update=false
indirection-table=Custodian

fk-pointing-to-this-class column=accountID /
fk-pointing-to-element-class column=userID /
  /collection-descriptor
  collection-descriptor
 name=bills
 element-class-ref=com.mobius.activebill.persistentobjects.Bill
 proxy=true

inverse-foreignkey field-ref=accountID/
/collection-descriptor
   /class-descriptor
   !-- Definitions for Custodian table --
   class-descriptor
  class=com.mobius.activebill.persistentobjects.Custodian
  table=Custodian
   
  field-descriptor
 name=accountID
 column=accountID
 jdbc-type=INTEGER
 primarykey=true
  /
  field-descriptor 
 name=rowVersion 
 column=rowVersion
 jdbc-type=INTEGER 
 locking=true
  /
  field-descriptor
 name=userID
 column=userID
 jdbc-type=INTEGER
 primarykey=true
  /
reference-descriptor
name=user
class-ref=com.mobius.activebill.persistentobjects.User
auto-retrieve=false

foreignkey field-ref=userID/
/reference-descriptor
reference-descriptor
name=account
class-ref=com.mobius.activebill.persistentobjects.Account
auto-retrieve=false

foreignkey field-ref=accountID/
/reference-descriptor
 /class-descriptor

thanks,
Bonnie MacKellar
software engineer
Mobius Management Systems, Inc.
[EMAIL PROTECTED]



Re: ojb-servlet WebApp on Tomcat

2003-06-26 Thread Gerhard Kreutzer
Gerhard Kreutzer wrote:

Hello,

I will use OJB in a web application running on Tomcat 4.1.24 using JDK 
1.4.1 on a Win2K box.


Here are some additional information.
After booting Tomcat and calling the ojb TestServlet the first time, 
ithe following Exception will be thrown:

java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableException
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at 
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.class$(Unknown Source)
at org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.load(Unknown 
Source)
at 
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.(Unknown 
Source)
at org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.(Unknown 
Source)
at org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.(Unknown 
Source)
at org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.(Unknown 
Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown 
Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source)
at 
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source)
at org.apache.ojb.servlet.TestServlet.getTableIterator(Unknown Source)
at org.apache.ojb.servlet.TestServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:466)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at 

Re: ojb-servlet WebApp on Tomcat

2003-06-26 Thread Cesar
Are y using the package commons-lang-1.0-mod.jar from jakarta commons?

[ ]´s
- Original Message -
From: Gerhard Kreutzer [EMAIL PROTECTED]
To: OJB Users List [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 3:43 PM
Subject: Re: ojb-servlet WebApp on Tomcat


Gerhard Kreutzer wrote:

 Hello,

 I will use OJB in a web application running on Tomcat 4.1.24 using JDK
 1.4.1 on a Win2K box.


Here are some additional information.
After booting Tomcat and calling the ojb TestServlet the first time,
ithe following Exception will be thrown:

java.lang.NoClassDefFoundError:
org/apache/commons/lang/exception/NestableException
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.class$(Unknow
n Source)
at
org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.load(Unknown
Source)
at
org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.(Unk
nown Source)
at org.apache.ojb.broker.util.configuration.impl.OjbConfiguration.(Unknown
Source)
at org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.(Unknown
Source)
at org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.(Unknown
Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown
Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown
Source)
at
org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn
own Source)
at org.apache.ojb.servlet.TestServlet.getTableIterator(Unknown Source)
at org.apache.ojb.servlet.TestServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java
:466)
at
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at

Sorted list

2003-06-26 Thread Saman Ghodsian
Hi everyone,

I've been trying to find a way to have a sorted list where I can do a
get method on the key, right now I'm using to lists, one that I have
implemented based on the java SortedMap list and a vector, then when OJB
uses the setList method I go and add all the elements to the sorted map,
and viceversa Problem is of course performance I've been looking
in implementing my Sorted List by implementing the ManageableCollection
Interface, the question Is if that's all I would need to do? Just
implement those methods and have my repository collection tag to my own
?
Anyone has come across this before? Any hints appreciated

Thanks,



Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



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



Re: Sorted list

2003-06-26 Thread Thomas Mahler
Hi,

Saman Ghodsian wrote:
Hi everyone,

I've been trying to find a way to have a sorted list where I can do a
get method on the key, right now I'm using to lists, one that I have
implemented based on the java SortedMap list and a vector, then when OJB
uses the setList method I go and add all the elements to the sorted map,
and viceversa Problem is of course performance I've been looking
in implementing my Sorted List by implementing the ManageableCollection
Interface, the question Is if that's all I would need to do? Just
implement those methods and have my repository collection tag to my own
?
yes, that should be sufficient. have a look at 
org.apache.ojb.broker.util.collections.ManageableHashSet for an example.
It is a HashSet that implements the ManageableCollection interface.

Are you willing to share your Map class? I'd love to add more user 
defined ManageableCollections to the util.collections package.

cheers,
Thomas
Anyone has come across this before? Any hints appreciated

Thanks,



Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada


-
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: Sorted list

2003-06-26 Thread Saman Ghodsian


Saman Ghodsian
CTO
Middle Earth Technologies Ltd.
www.metca.com
Cell (604)-839-7791
Vancouver, BC
Canada



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, June 26, 2003 12:34 PM
 To: OJB Users List
 Subject: Re: Sorted list
 
 
 Hi,
 
 Saman Ghodsian wrote:
  Hi everyone,
  
  I've been trying to find a way to have a sorted list where 
 I can do a 
  get method on the key, right now I'm using to lists, one 
 that I have 
  implemented based on the java SortedMap list and a vector, 
 then when 
  OJB uses the setList method I go and add all the elements to the 
  sorted map, and viceversa Problem is of course performance 
  I've been looking in implementing my Sorted List by 
 implementing the 
  ManageableCollection Interface, the question Is if that's 
 all I would 
  need to do? Just implement those methods and have my repository 
  collection tag to my own ?
 
 yes, that should be sufficient. have a look at 
 org.apache.ojb.broker.util.collections.ManageableHashSet for 
 an example. It is a HashSet that implements the 
 ManageableCollection interface.
Ok I'll try that way

 Are you willing to share your Map class? I'd love to add more user 
 defined ManageableCollections to the util.collections package.
For sure, I'll let you know when I'm done and tested the solution

 cheers,
 Thomas
 
  Anyone has come across this before? Any hints appreciated
  
  Thanks,
  
  
  
  Saman Ghodsian
  CTO
  Middle Earth Technologies Ltd.
  www.metca.com
  Cell (604)-839-7791
  Vancouver, BC
  Canada
  
  
  
  
 -
  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: SOLUTION for M:N never delete or always delete, no matter auto-delete=true or auto-delete=false

2003-06-26 Thread Edson Carlos Ericksson Richter
I don't think so.

First of all, OJB is always using RemovalAwareCollection if I don't specify
collection-class (I don't know why).
Since RemovalAwareCollection has a call to afterStore, the object is always
removed. I'm working a months with this problem, and trying to fix it. But
only with latest changes by thma (get by CVS HEAD) to make RemovalAware full
working, I get into the light, and with the changes I've done, the
MtoNTest#testDeletionFromBothTables and
MtoNTest#testDeletionFromIntermediaryTable should (I've not tested, only
with my own code) works fine.

I wan't to enphatize two points:

1) cvs HEAD doesn't accept Collection subclasses anymore (except the ones
that are Manageable). If you try to put a collection-class =
java.util.ArrayList or anything else, you'll get ClassCastException due a
ManageableCollection cast.

2) cvs HEAD with changes I've done make OJB M:N mapping work like expected,
with or without proxies, and not ignoring the
auto-delete=true/auto-delete=false.

If you have some time, try the junit tests (specially the ones related to
M:N) with changes proposed... I can even send you the changed files, if you
wish.

Is very important to me that OJB work fine with proxies and the M:N stuff.
This is the reason I'm so boring about it...


Best regards,

Edson Richter


- Original Message - 
From: Jakob Braeuchi [EMAIL PROTECTED]
To: OJB Users List [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 4:28 PM
Subject: Re: SOLUTION for M:N never delete or always delete, no matter
auto-delete=true or auto-delete=false


hi edson,

please have a look at the test case MtoNTest#testDeletionFromBothTables
(auto-delete ON)
and MtoNTest#testDeletionFromIntermediaryTable (auto-delete OFF).

the first one fails because ojb only deletes from intermediary table.
collection is not removal aware.


jakob

Edson Carlos Ericksson Richter wrote:

(this is a real long mail, but I've made a long research. The first part is
the reason I started to research, the second is explain why this occur. The
third is a suggestion of how can we correct).

FIRST PART:
Ok. To avoid the problem related to OJB always using
RemovalAwareCollection,
I put my beans to work as

public class A {
  private ArrayList myColl = new ArrayList();

  public void setMyCollection( List collection ) { this.myColl.clear;
this.myColl.addAll( collection ); }
  public List getMyCollection( ) {return this.myColl;}
}

Doing this, I'm converting from RemovalAwareCollection to ArrayList. Fine.

Now suppose that I want auto-delete=true. Then I

getMyCollection().remove(0);

and then persist the object. Theorically, OJB should delete the object from
indirection table AND the referenced table (the N side, ok?). This not
occur. OJB deletes only from indirection table (the auto-delete option
makes
no difference).

If I change the code to

public class A {
  private List myColl;

  public void setMyCollection( List collection ) {
this.myColl=collection; }
  public List getMyCollection( ) {return this.myColl;}
}

then it works (because the collection passed to setter is
RemovalAwareCollection). BUT, if I put auto-delete=false, then OJB still
delete the indirection table AND the referenced table (again, the
auto-delete option makes no difference).

SECOND PART:
To the facts: since OJB is using RemovalAwareCollection, after the correct
treatment for M:N non-decomposable queries (that my debugging show that it
is working like a charm), the following code is being executed:

// invoke callback on collection
if (col instanceof ManageableCollection)
{
((ManageableCollection) col).afterStore(this);
}

That is deleting the real objects, even if auto-delete=false.

THIRD PART:
The method deleteMtoNImplementor(...) should reset the
allObjectsToBeRemoved in RemovalAwareCollection if the auto-delete option
is set to false. What do you think? Something like create a RemovalAware
interface. Make all classes (RemovalAwareCollection, and RemovalAwareList
in
my case) implement it. Then do

public interface RemovalAware {

  public void resetDeleted();
}

The resetDelete method implementation is just

public void resetDeleted( ) {
  allObjectsToBeRemoved.clear();
}


and then change PersistentBrokerImpl to

currentMtoNKeys = getMtoNImplementor(cds, obj);
// delete unused m:n implementors
deleteMtoNImplementor(cds, obj, (Collection)col,
currentMtoNKeys);

if( col instanceof ManageableCollection 
!cds.getCascadeDelete() ) {
  Collection testCol;
  if( col instanceof CollectionProxy ) {
testCol = ( ( CollectionProxy )col ).getData();
  } else {
testCol = ( Collection )col;
  }

  if( testCol instanceof RemovalAware ) {
( ( RemovalAware 

Re: SOLUTION for M:N never delete or always delete, no matter auto-delete=trueor auto-delete=false

2003-06-26 Thread Jakob Braeuchi
hi edson,

i changed the testcases. now we have

auto-delete ON  RemovalAware  (ok)
auto-delete ON  not RemovalAware (fail)
auto-delete OFF  RemovalAware (fail)
auto-delete OFF  not RemovalAware (ok)
i could not find col.afterStore() when you check cascadeDelete ?

jakob

Edson Carlos Ericksson Richter wrote:

(this is a real long mail, but I've made a long research. The first part is
the reason I started to research, the second is explain why this occur. The
third is a suggestion of how can we correct).
FIRST PART:
Ok. To avoid the problem related to OJB always using RemovalAwareCollection,
I put my beans to work as
public class A {
 private ArrayList myColl = new ArrayList();
 public void setMyCollection( List collection ) { this.myColl.clear;
this.myColl.addAll( collection ); }
 public List getMyCollection( ) {return this.myColl;}
}
Doing this, I'm converting from RemovalAwareCollection to ArrayList. Fine.

Now suppose that I want auto-delete=true. Then I

getMyCollection().remove(0);

and then persist the object. Theorically, OJB should delete the object from
indirection table AND the referenced table (the N side, ok?). This not
occur. OJB deletes only from indirection table (the auto-delete option makes
no difference).
If I change the code to

public class A {
 private List myColl;
 public void setMyCollection( List collection ) { this.myColl=collection; }
 public List getMyCollection( ) {return this.myColl;}
}
then it works (because the collection passed to setter is
RemovalAwareCollection). BUT, if I put auto-delete=false, then OJB still
delete the indirection table AND the referenced table (again, the
auto-delete option makes no difference).
SECOND PART:
To the facts: since OJB is using RemovalAwareCollection, after the correct
treatment for M:N non-decomposable queries (that my debugging show that it
is working like a charm), the following code is being executed:
   // invoke callback on collection
   if (col instanceof ManageableCollection)
   {
   ((ManageableCollection) col).afterStore(this);
   }
That is deleting the real objects, even if auto-delete=false.

THIRD PART:
The method deleteMtoNImplementor(...) should reset the
allObjectsToBeRemoved in RemovalAwareCollection if the auto-delete option
is set to false. What do you think? Something like create a RemovalAware
interface. Make all classes (RemovalAwareCollection, and RemovalAwareList in
my case) implement it. Then do
public interface RemovalAware {

 public void resetDeleted();
}
The resetDelete method implementation is just

public void resetDeleted( ) {
 allObjectsToBeRemoved.clear();
}
and then change PersistentBrokerImpl to

   currentMtoNKeys = getMtoNImplementor(cds, obj);
   // delete unused m:n implementors
   deleteMtoNImplementor(cds, obj, (Collection)col,
currentMtoNKeys);
   if( col instanceof ManageableCollection 
!cds.getCascadeDelete() ) {
 Collection testCol;
 if( col instanceof CollectionProxy ) {
   testCol = ( ( CollectionProxy )col ).getData();
 } else {
   testCol = ( Collection )col;
 }
 if( testCol instanceof RemovalAware ) {
   ( ( RemovalAware )testCol ).resetDeleted();
 }
   }
This make M:N suff work working. I'm using CVS HEAD.

Thanks for your patience.

Edson Richter



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/6/2003
-
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: Latest CVS (rc4?), collection-class no longer work as definedin DTD

2003-06-26 Thread Thomas Mahler
Hi Edson,

the private Method you refer to is expected to return a 
ManageableCollection. thus it's required to do this cast.

I don't see how this could be avoided.

The method
private ManageableCollection getCollectionByQuery(Class collectionClass, 
Class itemClass, Query query)
is called by

public ManageableCollection getCollectionByQuery(Class collectionClass, 
Query query, boolean lazy) throws PersistenceBrokerException

which is again called by
public ManageableCollection getCollectionByQuery(Class collectionClass, 
Query query)

The javadoc of this method states:
Retrieve a userdefined Collection that implements the interface 
ManageableCollection that contains all Objects matching the Query query.

So we really rely on the fact that only ManeagbleCollections are used as 
collection-class entries.
But I think this has not changed for a very long time now?

cheers,
thomas
Edson Carlos Ericksson Richter wrote:
Hi! In my M:N testing work, I've discovered that class-descriptor now works
ONLY for ManageableCollections now.
This problem is caused by
private ManageableCollection getCollectionByQuery(Class collectionClass,
Class itemClass, Query query)
  ...
result = (ManageableCollection) collectionClass.newInstance();
 ...
in PersistenceBrokerImpl (1312).

Should not this piece of code be returning a Collection? See DTD:

 The collection-class may hold a fully qualified class name.
 This class must be the Java type of the Collection attribute.
 This attribute must only specified if the attribute type is not
 a java.util.Collection (or subclass) or Array type.
So, if we are forcing this to be a ManageableCollection, we are in trouble,
no?
Thanks for your attention.

Edson Richter



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.493 / Virus Database: 292 - Release Date: 25/6/2003
-
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: addSql on Query

2003-06-26 Thread Jakob Braeuchi
hi michael,

try using addSql:

   Query query;
   Criteria crit;
  
   crit = new Criteria();
   crit.addEqualTo(boss, new Boolean(true));
   crit.addSql(upper( name) like '%ER');
   query = new QueryByCriteria(Person.class, crit);
   broker.getCollectionByQuery(query);

hth
jakob
Michael Schulze wrote:

Hello,

I use OJB with the PB API and DB2.

I want to add FETCH x ROWS ONLY to a query to limit the number of rows
returned (I know i could do this with setEndAtIndex(x) too, but FETCH x
ROWS ONLY is faster).
What is missing is an addSql() method on the query to add free form sql
to the query the same way addOrderBy()... works. There is auch a
addSql() method for criteria.
Is there any reason why i can't add free form sql to a query, or is
there some other way to do this ?
Thanks,
Michael
-
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: addSql on Query

2003-06-26 Thread Jakob Braeuchi
hi michael,

sorry,  adding free form sql to a query is not supported.
please ignore my previous post .
jakob

Michael Schulze wrote:

Hello,

I use OJB with the PB API and DB2.

I want to add FETCH x ROWS ONLY to a query to limit the number of rows
returned (I know i could do this with setEndAtIndex(x) too, but FETCH x
ROWS ONLY is faster).
What is missing is an addSql() method on the query to add free form sql
to the query the same way addOrderBy()... works. There is auch a
addSql() method for criteria.
Is there any reason why i can't add free form sql to a query, or is
there some other way to do this ?
Thanks,
Michael
-
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: New Oracle 9i Feature

2003-06-26 Thread David . Corbin

And how are these two things configured?



|-+---
| |   Matthew Baird |
| |   [EMAIL PROTECTED]|
| |   otiva.com  |
| |   |
| |   06/26/2003 03:07|
| |   PM  |
| |   Please respond  |
| |   to OJB Users   |
| |   List   |
| |   |
|-+---
  
--|
  |
  |
  |To:  OJB Users List [EMAIL PROTECTED]   
 |
  |cc: 
  |
  |Subject: New Oracle 9i Feature  
  |
  |
  |
  
--|



I added support for Statement Caching (
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/jdbc30/StmtCacheSample/Readme.html
)

and Row Prefetching (
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/RowPrefetchSample/Readme.html
)

this is for 9i only

Enjoy.

-
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: New Oracle 9i Feature

2003-06-26 Thread Matthew Baird
That's a good question :)

right now, batch enablement is the same as with the current JDBC connector descriptor 
way of doing thing: 

 jdbc-connection-descriptor
jcd-alias=default
default-connection=true
platform=Oracle9i
jdbc-level=2.0
driver=oracle.jdbc.driver.OracleDriver
protocol=jdbc
subprotocol=oracle
dbalias=thin:@plqaibm2:1521:QADBI2
username=mbaird
password=mbaird
eager-release=false
batch-mode=false --- batch mode setting
useAutoCommit=1
ignoreAutoCommitExceptions=false

but the other stuff is not configurable yet. I wanted to think about how to do this 
and I came up with this idea (not implemented yet)

jdbc-connection-descriptor
jcd-alias=default
default-connection=true
jdbc-level=2.0
driver=oracle.jdbc.driver.OracleDriver
protocol=jdbc
subprotocol=oracle
dbalias=thin:@plqaibm2:1521:QADBI2
username=mbaird
password=mbaird
eager-release=false
batch-mode=false
useAutoCommit=1
platform=Oracle9i
ignoreAutoCommitExceptions=false
platform
property name=useRowPrefetch value=true/
property name=rowPrefetchSize value=100/
property name=useStatementCache value=true/
property name=setStatementCacheSize value=100/
/platform
connection
property name=fetchSize value=25/
/connection
/jdbc-connection-descriptor

and then make the platform options configurable for any property you want to set (just 
use reflection to find the set method for the property you want. You could also use 
this to set any connection info like fetch size, and this would just be passed through 
to the connection.

Of course this would mean changing the XML for jdbc connections again, but it would be 
backwards compatible.

any comments?


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 1:45 PM
To: OJB Users List
Cc: OJB Users List
Subject: Re: New Oracle 9i Feature



And how are these two things configured?



|-+---
| |   Matthew Baird |
| |   [EMAIL PROTECTED]|
| |   otiva.com  |
| |   |
| |   06/26/2003 03:07|
| |   PM  |
| |   Please respond  |
| |   to OJB Users   |
| |   List   |
| |   |
|-+---
  
--|
  |
  |
  |To:  OJB Users List [EMAIL PROTECTED]   
 |
  |cc: 
  |
  |Subject: New Oracle 9i Feature  
  |
  |
  |
  
--|



I added support for Statement Caching (
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/jdbc30/StmtCacheSample/Readme.html
)

and Row Prefetching (
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/RowPrefetchSample/Readme.html
)

this is for 9i only

Enjoy.

-
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]



ODMG API thread safety

2003-06-26 Thread Yang, Wenchao
I am using ojb-0.9.7 ODMG API exclusively in my multi-threaded application.
In my data model I have a very straight forward 1:M association between
class A(1) and class B(M). The application runs fine under single thread
configuration, but occasionally the application fails to behave properly
when multiple threads are enabled (each thread accesses the database via
ODMG API exclusively). The root cause to this is that the collection
attribute in A was not materialized, containing zero instance of B, while
the database actually has more than one instances of B that should have been
materialized into that collection attribute. 

I understand I should have written some simple code that can regenerates
this problem before I post this message. I am just hoping that maybe someone
already have some quick answer to this. 

Any help would be greatly appreciated. Thanks.

--Wenchao--

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



Re: SOLUTION for M:N never delete or always delete, no matter auto-delete=trueor auto-delete=false

2003-06-26 Thread Thomas Mahler
Hi Jakob,

Jakob Braeuchi wrote:
hi thomas,

so my testcases are wrong as well :(  (it's probably too hot here
:-)
to clarify this issue:
- when the collection IS removal aware the n side is ALWAYS deleted when 
removed from the collection (not matter of the auto-xxx settings).
- when the collection IS NOT removal aware the n side is NEVER deleted.
correct!

is this how it should be ?
I think so.
before the introduction of RemovalAwareCollections
irems that were deleted from colections did not get deleted during 
broker.store().
With RemovalAwareCollection we are now able to provide this semantics in 
the PB layer.

auto-delete should not have any impact on broker.store() semantics!

as usual
my 2c
Thomas

jakob

Thomas Mahler wrote:

Hi again,

Edson Carlos Ericksson Richter wrote:

(this is a real long mail, but I've made a long research. The first 
part is
the reason I started to research, the second is explain why this 
occur. The
third is a suggestion of how can we correct).

FIRST PART:
Ok. To avoid the problem related to OJB always using 
RemovalAwareCollection,
I put my beans to work as

public class A {
  private ArrayList myColl = new ArrayList();
  public void setMyCollection( List collection ) { this.myColl.clear;
this.myColl.addAll( collection ); }
  public List getMyCollection( ) {return this.myColl;}
}
Doing this, I'm converting from RemovalAwareCollection to ArrayList. 
Fine.

why do you type your attribute as ArrayList? if you just have List 
myColl = ... it would safe a lot of problems...

If you really wnat to use ARrayList just use
collection-class=ManageableArrayList in the collection-descriptor. 
This will avoid the addAll call!

Now suppose that I want auto-delete=true. Then I

getMyCollection().remove(0);

and then persist the object. Theorically, OJB should delete the 
object from
indirection table AND the referenced table (the N side, ok?). 


No! entries are deleted only from the indirection table! objects are 
only deleted automatically from the N side if you use a 
RemovalAwareCollection.

This not

occur. OJB deletes only from indirection table (the auto-delete 
option makes
no difference).


auto-delete does not change any behaviour of broker.store(...). It is 
meant to change behaviour of broker.delete(...) calls !

If I change the code to

public class A {
  private List myColl;
  public void setMyCollection( List collection ) { 
this.myColl=collection; }
  public List getMyCollection( ) {return this.myColl;}
}

then it works (because the collection passed to setter is
RemovalAwareCollection). 


as explained above.

BUT, if I put auto-delete=false, then OJB still
delete the indirection table AND the referenced table (again, the
auto-delete option makes no difference).


as expalined above.

SECOND PART:
To the facts: since OJB is using RemovalAwareCollection, after the 
correct
treatment for M:N non-decomposable queries (that my debugging show 
that it
is working like a charm), the following code is being executed:

// invoke callback on collection
if (col instanceof ManageableCollection)
{
((ManageableCollection) col).afterStore(this);
}
That is deleting the real objects, even if auto-delete=false.


if you don't want delete semantics just use
collection-class=ManageableArrayList in the collection-descriptor.
THIRD PART:
The method deleteMtoNImplementor(...) should reset the
allObjectsToBeRemoved in RemovalAwareCollection if the auto-delete 
option
is set to false. What do you think? 


I don't think so, because auto-delete is not used during store(..).

I think you problems can be solved by simple configuration settings. I 
did not see any errors in the mentioned OJB code. So I don't feel that 
the existing behaviour should be changed.

cheers,
Thomas
Something like create a RemovalAware
interface. Make all classes (RemovalAwareCollection, and 
RemovalAwareList in
my case) implement it. Then do

public interface RemovalAware {

  public void resetDeleted();
}
The resetDelete method implementation is just

public void resetDeleted( ) {
  allObjectsToBeRemoved.clear();
}
and then change PersistentBrokerImpl to

currentMtoNKeys = getMtoNImplementor(cds, obj);
// delete unused m:n implementors
deleteMtoNImplementor(cds, obj, (Collection)col,
currentMtoNKeys);
if( col instanceof ManageableCollection 
!cds.getCascadeDelete() ) {
  Collection testCol;
  if( col instanceof CollectionProxy ) {
testCol = ( ( CollectionProxy )col ).getData();
  } else {
testCol = ( Collection )col;
  }
  if( testCol instanceof RemovalAware ) {
( ( RemovalAware )testCol ).resetDeleted();
  }
}
This make M:N suff work working. I'm 

Re: SOLUTION for M:N never delete or always delete, no matter auto-delete=true or auto-delete=false

2003-06-26 Thread Edson Carlos Ericksson Richter
Yes, Jakob gets the point.

As far as I understood, if I don't specify the collection-class, OJB will
use RemovalAwareCollection.
Being as is, when I remove an object from the intermediary collection, the N
object should be deleted from the N table when we store the M object only
when auto-delete feature is true.

If the collection-class is not RemovalAware, then there is no problem.
Things should be as they had from months. Or OJB should not use
RemovalAwareCollection as default for M:N non-decomposible.

That's about my hack is.

I undertand Thomas points about my configuration. He is right. Maybe the
only thing that should be fixed is documentation. Maybe I'm doing some kind
of biggest-than-ever mistake. Check what a kind of collection-descriptor I
use here:

collection-descriptor
 name=perfis
 element-class-ref=br.com.mgr.beans.PerfilPessoaFJBean
 indirection-table=RL_PESSOA_TIPOPESSOA
 proxy=true
 auto-retrieve=true
 auto-update=false
 auto-delete=false
   fk-pointing-to-this-class column=CO_PESSOA/
   fk-pointing-to-element-class column=CO_TIPO_PESSOA/
/collection-descriptor

where perfis is related to setPerfis and getPerfis:

public class Pessoa {
  private List perfis;
  public void setPerfis( List p ) {this.perfis=p;}
  public List getPerfis( ) {return this.perfis;}
}

Just it!

Now, if I delete an element as in getPerfis().remove(0) and then
broker.store( pessoa ), the real object is not anymore deleted.
And if I put auto-delete=true and issue getPerfis().remove(0) and then
broker.store( pessoa ), the indirection record and the real object is
deleted.

May be this a my mis-interpretation? Why M:N documentation don't say
anything about use ManageableArrayList if you wish your objects not being
deleted from the N side? And that RemovalAwareCollection is the default
collection if you don't specify one?

Excuse-me if all this thread is my mistake, but I'm very happy because after
fix tomorrow, all my app came to a stable and clear behaviour...

Thanks,

Edson Richter


- Original Message - 
From: Jakob Braeuchi [EMAIL PROTECTED]
To: OJB Users List [EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 5:27 PM
Subject: Re: SOLUTION for M:N never delete or always delete, no matter
auto-delete=true or auto-delete=false


hi thomas,

so my testcases are wrong as well :(  (it's probably too hot here)

to clarify this issue:
- when the collection IS removal aware the n side is ALWAYS deleted when
removed from the collection (not matter of the auto-xxx settings).
- when the collection IS NOT removal aware the n side is NEVER deleted.

is this how it should be ?

jakob

Thomas Mahler wrote:

 Hi again,

 Edson Carlos Ericksson Richter wrote:

 (this is a real long mail, but I've made a long research. The first
 part is
 the reason I started to research, the second is explain why this
 occur. The
 third is a suggestion of how can we correct).

 FIRST PART:
 Ok. To avoid the problem related to OJB always using
 RemovalAwareCollection,
 I put my beans to work as

 public class A {
   private ArrayList myColl = new ArrayList();

   public void setMyCollection( List collection ) { this.myColl.clear;
 this.myColl.addAll( collection ); }
   public List getMyCollection( ) {return this.myColl;}
 }

 Doing this, I'm converting from RemovalAwareCollection to ArrayList.
 Fine.


 why do you type your attribute as ArrayList? if you just have List
 myColl = ... it would safe a lot of problems...

 If you really wnat to use ARrayList just use
 collection-class=ManageableArrayList in the collection-descriptor.
 This will avoid the addAll call!

 Now suppose that I want auto-delete=true. Then I

 getMyCollection().remove(0);

 and then persist the object. Theorically, OJB should delete the
 object from
 indirection table AND the referenced table (the N side, ok?).


 No! entries are deleted only from the indirection table! objects are
 only deleted automatically from the N side if you use a
 RemovalAwareCollection.

 This not

 occur. OJB deletes only from indirection table (the auto-delete
 option makes
 no difference).


 auto-delete does not change any behaviour of broker.store(...). It is
 meant to change behaviour of broker.delete(...) calls !


 If I change the code to

 public class A {
   private List myColl;

   public void setMyCollection( List collection ) {
 this.myColl=collection; }
   public List getMyCollection( ) {return this.myColl;}
 }

 then it works (because the collection passed to setter is
 RemovalAwareCollection).


 as explained above.

 BUT, if I put auto-delete=false, then OJB still
 delete the indirection table AND the referenced table (again, the
 auto-delete option makes no difference).


 as expalined above.

 SECOND PART:
 To the facts: since OJB is using RemovalAwareCollection, after the
 correct
 treatment for M:N non-decomposable queries (that my debugging show
 that it
 is working like a charm), the following code 

RE: New Oracle 9i Feature

2003-06-26 Thread Matthew Baird
well that's the beauty of the Platform design. They just work! No need to do anything 
other than set your platform to Oracle9i

I promise I will get around to documenting at some point.

m

-Original Message-
From: Thomas Mahler [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 2:08 PM
To: OJB Users List
Subject: Re: New Oracle 9i Feature


how about a short howto-use-advanced9i-features.html ?

;-)

cheers,
thomas

Matthew Baird wrote:
 That's a good question :)
 
 right now, batch enablement is the same as with the current JDBC connector 
 descriptor way of doing thing: 
 
  jdbc-connection-descriptor
   jcd-alias=default
   default-connection=true
   platform=Oracle9i
   jdbc-level=2.0
   driver=oracle.jdbc.driver.OracleDriver
   protocol=jdbc
   subprotocol=oracle
   dbalias=thin:@plqaibm2:1521:QADBI2
   username=mbaird
   password=mbaird
   eager-release=false
   batch-mode=false --- batch mode setting
   useAutoCommit=1
 ignoreAutoCommitExceptions=false
 
 but the other stuff is not configurable yet. I wanted to think about how to do this 
 and I came up with this idea (not implemented yet)
 
 jdbc-connection-descriptor
   jcd-alias=default
   default-connection=true
   jdbc-level=2.0
   driver=oracle.jdbc.driver.OracleDriver
   protocol=jdbc
   subprotocol=oracle
   dbalias=thin:@plqaibm2:1521:QADBI2
   username=mbaird
   password=mbaird
   eager-release=false
   batch-mode=false
   useAutoCommit=1
   platform=Oracle9i
 ignoreAutoCommitExceptions=false
   platform
   property name=useRowPrefetch value=true/
   property name=rowPrefetchSize value=100/
   property name=useStatementCache value=true/
   property name=setStatementCacheSize value=100/
   /platform
   connection
   property name=fetchSize value=25/
   /connection
 /jdbc-connection-descriptor
 
 and then make the platform options configurable for any property you want to set 
 (just use reflection to find the set method for the property you want. You could 
 also use this to set any connection info like fetch size, and this would just be 
 passed through to the connection.
 
 Of course this would mean changing the XML for jdbc connections again, but it would 
 be backwards compatible.
 
 any comments?
 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 26, 2003 1:45 PM
 To: OJB Users List
 Cc: OJB Users List
 Subject: Re: New Oracle 9i Feature
 
 
 
 And how are these two things configured?
 
 
 
 |-+---
 | |   Matthew Baird |
 | |   [EMAIL PROTECTED]|
 | |   otiva.com  |
 | |   |
 | |   06/26/2003 03:07|
 | |   PM  |
 | |   Please respond  |
 | |   to OJB Users   |
 | |   List   |
 | |   |
 |-+---
   
 --|
   |  
 |
   |To:  OJB Users List [EMAIL PROTECTED] 
|
   |cc:   
 |
   |Subject: New Oracle 9i Feature
 |
   |  
 |
   
 --|
 
 
 
 I added support for Statement Caching (
 http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/jdbc30/StmtCacheSample/Readme.html
 )
 
 and Row Prefetching (
 http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/RowPrefetchSample/Readme.html
 )
 
 this is for 9i only
 
 Enjoy.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
 
 

Refresh attribute question

2003-06-26 Thread Mykola Ostapchuk
Hello,

I'm new to OJB. Can anybody explain to me the purpose of refresh attribute
for reference-descriptor?
All I found is: The refresh attribute can be set to true to force OJB to
refresh object references on instance loading. ...

The second - I don't understand why this attribute by default is false?
When I'm doing any update to parent table - child table is populated
with NULL values if refresh is set to false.
I just don't see the reason - why BY DEFAULT parent object in child
table shouldn't change.
Or maybee I'm missing something?


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



DB2 Error - Can Anybody Help?

2003-06-26 Thread Shane Mingins
Hi

This is one of those not sure how to describe the problem problem *grin*

I have a set of tests in a TestCase that were displaying unusual behaviour.
One that failed when the entire case was run did not fail when executed
solely on its own.

So I changed the order and have found the following error:

.[org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on object level
failed for tx [EMAIL PROTECTED]
[SQL0901] SQL system error.
java.sql.BatchUpdateException: [SQL0901] SQL system error.
at
com.ibm.as400.access.AS400JDBCPreparedStatement.executeBatch(AS400JDBCPrepar
edStatement.java:988)


I have replicated the problem with other versions of OJB so no problem
there.

I then changed the database to MySQL and everything works fine.

I have searched the IBM site and a SQL0901 error can be caused by a range of
things, nothing I could see sparked any eureka moments.

It is my gut feeling that it is not anything to do with the actual
generated SQL but somehow the order in which they are being executed ...
like something has a lock on a table still???

I am at a bit of a loss as to where to go to next.  

Has anybody come across this error with the AS400 and/or DB2?

Or can anyone point me in some direction to help me find out more info about
this?

TIA
Shane

Shane Mingins
Analyst Programmer
Assure NZ Ltd
Ph 644 494 2522



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



RE: DB2 Error - Can Anybody Help?

2003-06-26 Thread Matthew Baird
That's the something happened that's so severe that you should call db2 service 
error.

it appears to be happening during the execution of a batch. You could try turning off 
batch, although I think you may have to do that in code and recompile.

m

-Original Message-
From: Shane Mingins [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 3:34 PM
To: 'OJB Users List'
Subject: DB2 Error - Can Anybody Help?


Hi

This is one of those not sure how to describe the problem problem *grin*

I have a set of tests in a TestCase that were displaying unusual behaviour.
One that failed when the entire case was run did not fail when executed
solely on its own.

So I changed the order and have found the following error:

.[org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on object level
failed for tx [EMAIL PROTECTED]
[SQL0901] SQL system error.
java.sql.BatchUpdateException: [SQL0901] SQL system error.
at
com.ibm.as400.access.AS400JDBCPreparedStatement.executeBatch(AS400JDBCPrepar
edStatement.java:988)


I have replicated the problem with other versions of OJB so no problem
there.

I then changed the database to MySQL and everything works fine.

I have searched the IBM site and a SQL0901 error can be caused by a range of
things, nothing I could see sparked any eureka moments.

It is my gut feeling that it is not anything to do with the actual
generated SQL but somehow the order in which they are being executed ...
like something has a lock on a table still???

I am at a bit of a loss as to where to go to next.  

Has anybody come across this error with the AS400 and/or DB2?

Or can anyone point me in some direction to help me find out more info about
this?

TIA
Shane

Shane Mingins
Analyst Programmer
Assure NZ Ltd
Ph 644 494 2522



-
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: DB2 Error - Can Anybody Help?

2003-06-26 Thread Shane Mingins
Yes I have seen comments about it being a call IBM message :-)

When referring to batch do you mean the batch-mode property in my JDBC
connection descriptor for OJB?

Thanks
Shane

-Original Message-
From: Matthew Baird [mailto:[EMAIL PROTECTED] 
Sent: Friday, 27 June 2003 10:33 a.m.
To: OJB Users List
Subject: RE: DB2 Error - Can Anybody Help?

That's the something happened that's so severe that you should call db2
service error.

it appears to be happening during the execution of a batch. You could try
turning off batch, although I think you may have to do that in code and
recompile.

m

-Original Message-
From: Shane Mingins [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 3:34 PM
To: 'OJB Users List'
Subject: DB2 Error - Can Anybody Help?


Hi

This is one of those not sure how to describe the problem problem *grin*

I have a set of tests in a TestCase that were displaying unusual behaviour.
One that failed when the entire case was run did not fail when executed
solely on its own.

So I changed the order and have found the following error:

.[org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on object level
failed for tx [EMAIL PROTECTED]
[SQL0901] SQL system error.
java.sql.BatchUpdateException: [SQL0901] SQL system error.
at
com.ibm.as400.access.AS400JDBCPreparedStatement.executeBatch(AS400JDBCPrepar
edStatement.java:988)


I have replicated the problem with other versions of OJB so no problem
there.

I then changed the database to MySQL and everything works fine.

I have searched the IBM site and a SQL0901 error can be caused by a range of
things, nothing I could see sparked any eureka moments.

It is my gut feeling that it is not anything to do with the actual
generated SQL but somehow the order in which they are being executed ...
like something has a lock on a table still???

I am at a bit of a loss as to where to go to next.  

Has anybody come across this error with the AS400 and/or DB2?

Or can anyone point me in some direction to help me find out more info about
this?

TIA
Shane

Shane Mingins
Analyst Programmer
Assure NZ Ltd
Ph 644 494 2522



-
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: DB2 Error - Can Anybody Help?

2003-06-26 Thread Armin Waibel

- Original Message -
From: Matthew Baird [EMAIL PROTECTED]
To: OJB Users List [EMAIL PROTECTED]
Sent: Friday, June 27, 2003 12:32 AM
Subject: RE: DB2 Error - Can Anybody Help?


That's the something happened that's so severe that you should call db2
service error.

it appears to be happening during the execution of a batch. You could
try turning off batch, although I think you may have to do that in code
and recompile.
#
when using CVS this could be done by set
batch-mode=false
then all setBatch(...) statements in code ignored.

If using rc3, get latest ConnectionManagerImpl from
CVS or patch setBatchMode-method to
 public void setBatchMode(boolean mode)
{
batchMode = mode  jcd.getBatchMode();
}

regards,
Armin


m

-Original Message-
From: Shane Mingins [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 3:34 PM
To: 'OJB Users List'
Subject: DB2 Error - Can Anybody Help?


Hi

This is one of those not sure how to describe the problem problem
*grin*

I have a set of tests in a TestCase that were displaying unusual
behaviour.
One that failed when the entire case was run did not fail when executed
solely on its own.

So I changed the order and have found the following error:

.[org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on object level
failed for tx [EMAIL PROTECTED]
[SQL0901] SQL system error.
java.sql.BatchUpdateException: [SQL0901] SQL system error.
at
com.ibm.as400.access.AS400JDBCPreparedStatement.executeBatch(AS400JDBCPr
epar
edStatement.java:988)


I have replicated the problem with other versions of OJB so no problem
there.

I then changed the database to MySQL and everything works fine.

I have searched the IBM site and a SQL0901 error can be caused by a
range of
things, nothing I could see sparked any eureka moments.

It is my gut feeling that it is not anything to do with the actual
generated SQL but somehow the order in which they are being executed ...
like something has a lock on a table still???

I am at a bit of a loss as to where to go to next.

Has anybody come across this error with the AS400 and/or DB2?

Or can anyone point me in some direction to help me find out more info
about
this?

TIA
Shane

Shane Mingins
Analyst Programmer
Assure NZ Ltd
Ph 644 494 2522



-
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: DB2 Error - Can Anybody Help?

2003-06-26 Thread Shane Mingins
Matthew  Armin

Thanks, I changed the code, and it all goes :-)

Cheers
Shane

-Original Message-
From: Armin Waibel [mailto:[EMAIL PROTECTED] 
Sent: Friday, 27 June 2003 10:43 a.m.
To: OJB Users List
Subject: Re: DB2 Error - Can Anybody Help?


- Original Message -
From: Matthew Baird [EMAIL PROTECTED]
To: OJB Users List [EMAIL PROTECTED]
Sent: Friday, June 27, 2003 12:32 AM
Subject: RE: DB2 Error - Can Anybody Help?


That's the something happened that's so severe that you should call db2
service error.

it appears to be happening during the execution of a batch. You could
try turning off batch, although I think you may have to do that in code
and recompile.
#
when using CVS this could be done by set
batch-mode=false
then all setBatch(...) statements in code ignored.

If using rc3, get latest ConnectionManagerImpl from
CVS or patch setBatchMode-method to
 public void setBatchMode(boolean mode)
{
batchMode = mode  jcd.getBatchMode();
}

regards,
Armin


m

-Original Message-
From: Shane Mingins [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 26, 2003 3:34 PM
To: 'OJB Users List'
Subject: DB2 Error - Can Anybody Help?


Hi

This is one of those not sure how to describe the problem problem
*grin*

I have a set of tests in a TestCase that were displaying unusual
behaviour.
One that failed when the entire case was run did not fail when executed
solely on its own.

So I changed the order and have found the following error:

.[org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on object level
failed for tx [EMAIL PROTECTED]
[SQL0901] SQL system error.
java.sql.BatchUpdateException: [SQL0901] SQL system error.
at
com.ibm.as400.access.AS400JDBCPreparedStatement.executeBatch(AS400JDBCPr
epar
edStatement.java:988)


I have replicated the problem with other versions of OJB so no problem
there.

I then changed the database to MySQL and everything works fine.

I have searched the IBM site and a SQL0901 error can be caused by a
range of
things, nothing I could see sparked any eureka moments.

It is my gut feeling that it is not anything to do with the actual
generated SQL but somehow the order in which they are being executed ...
like something has a lock on a table still???

I am at a bit of a loss as to where to go to next.

Has anybody come across this error with the AS400 and/or DB2?

Or can anyone point me in some direction to help me find out more info
about
this?

TIA
Shane

Shane Mingins
Analyst Programmer
Assure NZ Ltd
Ph 644 494 2522



-
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: log4j with jBoss, bis

2003-06-26 Thread Phil Warrick
Hi,

It's OK now.  I wasn't keeping all my OJB.properties files well 
synchronized.  My LoggerClass setting was

LoggerClass=org.apache.ojb.broker.util.logging.PoorMansLoggerImpl

rather than

LoggerClass=org.apache.ojb.broker.util.logging.Log4jLoggerImpl

I have different OJB.properties file for standalone OJB development and 
jboss development and they diverged.

In summary, to use log4j logging with OJB within jBoss,

1) set LoggerClass in OJB.properties as described above.  There is no 
need for a log4j.properties file of OJB-specific log4j settings (in fact 
the OJB.properties setting LoggerConfigFile is ignored).  Instead, the 
jBoss log4j configuration file must be used:
2) in JBOSS_HOME/server/default/conf/log4j.xml, add categories to define 
appenders and add/filter logging for desired OJB packages following the 
numerous examples in that file.  For example,

category name=org.apache.ojb
priority value=DEBUG /
appender-ref ref=CONSOLE/
appender-ref ref=FILE/
  /category

category name=org.apache.ojb.broker.metadata.RepositoryXmlHandler
priority value=ERROR /
appender-ref ref=CONSOLE/
appender-ref ref=FILE/
   /category
Armin, do you think this is sufficiently on-topic to be a short addition 
to the deployment-jBoss section of the docs?

Phil

Phil Warrick wrote:
Hi all,

I'm having trouble turning on OJB logging with log4j within jBoss.  My
jboss/server/default/conf/log4j.xml is below (Thanks Dave Derry).  I'm 
able to control the level of org.jboss logging with this file, but the 
only OJB logging I see is level INFO.  Can anyone see what's wrong?

Thanks,

Phil

?xml version=1.0 encoding=UTF-8?
!DOCTYPE log4j:configuration SYSTEM log4j.dtd
!-- 
= --
!----
!--  Log4j Configuration--
!----
!-- 
= --

!-- $Id: log4j.xml,v 1.5.2.6 2002/09/27 22:29:24 patriot1burke Exp $ --

!--
   | For more configuration infromation and examples see the Jakarta Log4j
   | owebsite: http://jakarta.apache.org/log4j
 --
log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; 
debug=false

  !-- = --
  !-- Preserve messages in a local file --
  !-- = --
  !-- A time/date based rolling appender --
  appender name=FILE 
class=org.jboss.logging.appender.DailyRollingFileAppender
param name=File value=${jboss.server.home.dir}/log/server.log/
param name=Append value=false/
param name=Threshold value=INFO/

!-- Rollover at midnight each day --
param name=DatePattern value='.'-MM-dd/
!-- Rollover at the top of each hour
param name=DatePattern value='.'-MM-dd-HH/
--
layout class=org.apache.log4j.PatternLayout
  !-- The default pattern: Date Priority [Category] Message\n --
  param name=ConversionPattern value=%d %-5p [%c] %m%n/
  !-- The full pattern: Date MS Priority [Category] (Thread:NDC) 
Message\n
  param name=ConversionPattern value=%d %-5r %-5p [%c] (%t:%x) 
%m%n/
   --
/layout   
  /appender

  !-- A size based file rolling appender
  appender name=FILE 
class=org.jboss.logging.appender.RollingFileAppender
param name=File value=${jboss.server.home.dir}/log/server.log/
param name=Append value=false/
param name=MaxFileSize value=500KB/
param name=MaxBackupIndex value=1/

layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern value=%d %-5p [%c] %m%n/
/layout   
  /appender
  --

  !-- == --
  !-- Append messages to the console --
  !-- == --
  appender name=CONSOLE class=org.apache.log4j.ConsoleAppender
!--param name=Threshold value=INFO/--
param name=Threshold value=DEBUG/
param name=Target value=System.out/
layout class=org.apache.log4j.PatternLayout
  !-- The default pattern: Date Priority [Category] Message\n --
  param name=ConversionPattern value=%d{ABSOLUTE} %-5p [%c{1}] 
%m%n/
/layout
  /appender

  !-- == --
  !-- More Appender examples --
  !-- == --
  !-- Buffer events and log them asynchronously
  appender name=ASYNC class=org.apache.log4j.AsyncAppender
appender-ref ref=FILE/
appender-ref ref=CONSOLE/
appender-ref ref=SMTP/
  /appender
  --
  !-- EMail events to an administrator
  appender name=SMTP class=org.apache.log4j.net.SMTPAppender
param name=Threshold value=ERROR/
param name=To value=[EMAIL PROTECTED]/
param name=From value=[EMAIL PROTECTED]/
param name=Subject value=JBoss Sever Errors/
param name=SMTPHost value=localhost/
param name=BufferSize value=10/
layout class=org.apache.log4j.PatternLayout
  param name=ConversionPattern value=[%d{ABSOLUTE},%c{1}] %m%n/
/layout
  /appender
  --
  !-- Syslog events
  appender name=SYSLOG class=org.apache.log4j.net.SyslogAppender
param 

Re: ojb-servlet WebApp on Tomcat

2003-06-26 Thread Gerhard Kreutzer
Cesar wrote:

Are y using the package commons-lang-1.0-mod.jar from jakarta commons?

 

No

--
KreutzerSoft
Bärenbühlgraben 76, 90475 Nürnberg
Tel: +49-911-8324-57
Fax: +49-911-8324-61
mailto:[EMAIL PROTECTED]
http://www.KreutzerSoft.de 



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