Re: abort transaction causes TransactionNotInProgressException

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

2003-06-25 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: web app in jboss -- where to put files?

2003-06-25 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.(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.(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.(Unknown
> Source)
> at
org.apache.ojb.broker.metadata.MetadataManager.(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]



ojb-servlet WebApp on Tomcat

2003-06-25 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 --

http://java.sun.com/dtd/web-app_2_3.dtd";>

 Apache OJB V1.0 28.6.2003
WebApp for Apache OJB V1.0 28.6.2003 
KreutzerSoft.de

 
TestServlet 
org.apache.ojb.servlet.TestServlet 
 
 
   TestServlet
 /servlet/TestServlet
   
   
 
   invoker
   /servlet/*
 

-
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: Dynamic proxies and references Help

2003-06-25 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]


Re: java.lang.StackOverflowError within ODMG

2003-06-25 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 com

Re: forward-db

2003-06-25 Thread Thomas Mahler
Hi Julia,

the forward-db target was an experimental piece of code.
It is no longer part of the distribution. I'll remove the reference from 
tutorial1.

The recommended way to forward engineer a repository.xml from Java 
source code is the Ojb-XDoclet module:
http://cvs.apache.org/viewcvs/db-ojb/contrib/xdoclet-ojb-module.zip

the package also contains a complete set of documentation.

More details on XDoclet itself:
http://xdoclet.sourceforge.net/
cheers,
Thomas
[EMAIL PROTECTED] wrote:
Hello,

I've downloaded the latest relaese 1.0 rc3 and found in the documentation
(tutorial1) the tool support for foward engineering (generating SQL DDL from
repository.xml). But the ant target named "forward-db" is missing in my
build.xml. Only the reverse tool with the target "reverse-db" is included.
Where can I find the tool or how to write the target on my own?
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-25 Thread Thomas Mahler
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]


Dynamic proxies and references Help

2003-06-25 Thread Marcus Breese
It seems that I'm having problems posting to the list.  At any rate...

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]


PATCH: Can't recreate previously deleted object

2003-06-25 Thread sclark
I am using rc3, ODMG.

I have encountered the following incorrect behavior:

   tx {
 Retrieve Role{1}
   }
   tx {
 Delete Role{1}
 role = new Role{2}
 lock role
   }
   tx {
 Delete Role{2}
 role = new Role{1}
 lock role
   }

Role{1} is not inserted into the db in the final transaction.  According to the
log, Role{1} gets registered with StateOldClean, which is incorrect.

Here is my analysis:

  (1) ObjectEnvelope.setInitialModificationState() has this code:

if (LoadedObjectsRegistry.isRegistered(myObj))
{
initialState = org.apache.ojb.odmg.states.StateOldClean.getInstance();
}

  That is, when an object is registered with a tx, if it has been seen before
  then it is always registered as StateOldClean.  I think that theoretically
  "seen before" means "seen in a currently running PB transaction", but I'm not
  certain of this.

  (2) LoadedObjectsRegistry has the following comment:

Note: objects remain registered even after they are deleted. This
is necessary to prevent creation of deleted objects by another
thread, see http://archives.apache.org/eyebrowse/ReadMsg?listId=106&msgNo=1382";>this
for details.

  Because the list archives are broken, I can't read that thread to see what
  the  problem was or the reasoning about the solution.

  (3) PersistenceBrokerImpl.delete() calls objectCache.remove(), rather than
  this.removeFromCache().  This has the effect described in (2), i.e., the
  deleted object is removed from the cache but not from LoadedObjectsRegistry.

  (4) After calling broker.delete(), StateOldDelete.commit() calls
  broker.removeFromCache().  The latter call looks up the oid in the cache and
  then removes the object it finds from LoadedObjectsRegistry.  Because delete()
  has already removed the object from the cache, LoadedObjectsRegistry.remove()
  is called with null, and the object stays in the LOR forever.

As a result, it will never be possible to recreate the object in question.

I have fixed the problem by replacing

 objectCache.remove(new Identity(obj, this, cld));

with

 removeFromCache(new Identity(obj, this, cld));

in PersistenceBrokerImpl.delete().  But I think that this probably breaks the issue
mentioned in the LoadedObjectsRegistry comment.  Perhaps somebody who understands
that issue could look into this bug?

An alternative fix, which seems somewhat less robust but won't trip over the issue
in (2), is for PersistenceBrokerImpl.removeFromCache() not to rely on the object
being in the cache in order to remove it from the LOR unless it has to.  Here is a
patch implementing this solution:

public void removeFromCache(Object obj) throws PersistenceBrokerException
{
// objects must also be remove from LoadedObjectsRegistry
// Fix by Jamie Burns
Identity identity;
Object objectToRemove;
if (obj instanceof Identity)
{
identity = (Identity)obj;
objectToRemove = objectCache.lookup(identity);
}
else
{
identity = new Identity(obj, this);
objectToRemove = obj;
}
LoadedObjectsRegistry.remove(objectToRemove);
objectCache.remove(identity);
}

Can somebody please apply one or the other (or yet another, if that is appropriate)
patch to CVS?

thanks,
-steve

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


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



Dynamic proxies and references Help

2003-06-25 Thread Marcus Breese
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]


log4j with jBoss, bis

2003-06-25 Thread Phil Warrick
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












http://jakarta.apache.org/log4j/"; 
debug="false">

  
  
  
  
  








  
  
  
	
  

  
  
  
  
  




  
  

  

  
  
  
  
  
  
  

  
  
  
  
  

  
  
  
  
  

  



  
  



  
  
  
  
  


  
  
  


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


RE: New Functionality: Oracle-style JDBC Batching

2003-06-25 Thread Chiah Tong Kiat
Hi

Can't wait for your new JCA connector. I'm using connection pooling in
WebLogic.


-Original Message-
From: Matthew Baird [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 26, 2003 9:13 AM
To: OJB Users List
Subject: New Functionality: Oracle-style JDBC Batching

For all our Oracle 9i users out there:

Oracle has a special style of batching which is higher performance than
normal JDBC batching. See
http://technet.oracle.com/products/oracle9i/daily/jun07.html for more
information.

No special configurations are required, just make sure Batching is set to on
in your connection information (repository_database.xml)
ie. 


and use the new Oracle9i Platform setting in your build.properties
ie.

profile=oracle9i

The implementation in the PlatformOracle9iImpl uses reflection to try and
find the Oracle specific batching methods. It will degrade gracefully to use
the default JDBC batching if the methods are not found.

If your PreparedStatements are wrapped (ie you obtain connections from a
JDBC pool in JBOSS) the Oracle batching will not work, as it won't find the
methods. This will not be an issue after I check in the JCA connector, as
you will use a raw connection and raw preparedstatements rather than from
the app servers datasource (much easier to debug!). Just waiting for Thomas
to tell me how/when to check that stuff in :)

example results:

PersistenceBroker API with Oracle style Batching
[ojb] [performance] INFO: inserting 2500 Objects: 329 msec
[ojb] [performance] INFO: updating 2500 Objects: 406 msec
[ojb] [performance] INFO: deleting 2500 Objects: 391 msec
[ojb] [performance] INFO:
[ojb] [performance] INFO: inserting 2500 Objects: 344 msec
[ojb] [performance] INFO: updating 2500 Objects: 406 msec
[ojb] [performance] INFO: deleting 2500 Objects: 375 msec

Raw JDBC with no batching
[jdbc] [performance] INFO: inserting 2500 Objects: 1188 msec
[jdbc] [performance] INFO: updating 2500 Objects: 1187 msec
[jdbc] [performance] INFO: deleting 2500 Objects: 954 msec
[jdbc] [performance] INFO:
[jdbc] [performance] INFO: inserting 2500 Objects: 1203 msec
[jdbc] [performance] INFO: updating 2500 Objects: 1171 msec
[jdbc] [performance] INFO: deleting 2500 Objects: 954 msec

OJB is no slouch ;)

cheers,
Matthew

-
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-25 Thread Phil Warrick
Hi Armin,

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











  
  
  
  
  

  





  
  

OracleDS


  
jdbc:oracle:thin:@127.0.0.1:1521:mondp
oracle.jdbc.driver.OracleDriver

MOND_USER
MOND_PASS
  





jboss.jca:service=RARDeployment,name=JBoss 
LocalTransaction JDBC Wrapper
  



  
  

0
50
5000
15

ByContainer
  


jboss.jca:service=CachedConnectionManager

jboss.security:service=JaasSecurityManager

java:/TransactionManager


jboss.jca:service=RARDeployer
  



Hi Armin,

 > - sequence manager, which implementation?

SequenceManagerHighLowImpl (I know that you don't suggest it with JBoss, 
but the failure scenario you mentioned a few week ago didn't see to 
apply (where a rollback causes problems).  I plan to move towards 
dbms-generated sequences, but one step at a time...

 > - exhausted DataSource pool (db-connection pool, jboss)?

I use default settings for the OracleDS, should this be changed in 
oracle-service.xml?

Phil

Armin Waibel wrote:

Hi Phil,

sounds like a deadlock.

But first a few pointers to help
me in my investigation would be very welcome


- sequence manager, which implementation?
- exhausted DataSource pool (db-connection pool, jboss)?
regards,
Armin
- Original Message -
From: "Phil Warrick" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 4:46 PM
Subject: [jBoss] multiuser problems


Hi all,

I have a j2ee client app that talks to the database via jboss and ojb.
This app works fine when there is only one client talking to jboss at


a

time.  It even works fine when I create several pseudo-clients in the
same app running separate connections in their own threads (similar to
the ojb ejb stress tests).  However when I run this test with two
separate client machines, each writing to completely different sets of
objects, things silently hang in jBoss, and I cannot make any further
remote calls.  Note that there should not be a problem of simultaneous
access to the same persistent object.  I need to restart jBoss to be


up

again.

I realize that I am only giving a general description of the problem,
and I intend to investigate further so that I have (hopefully) some
stack traces instead of silent death.   But first a few pointers to


help

me in my investigation would be very welcome.

First my setup is the following:
WinNT - jBoss 3.0.6 - ojb1.0rc2 - Oracle 8.1.6
I've held off moving up to rc3/4 due to the myriad of sequence


problems

that I and numerous other Oracle users experienced with rc3.  I'm
willing to roll up my sleeves and move to rc4 if required (is it
possible that this is a bug that has been address recently -- I don't
see any bug reports quite like this).  Hopefully the sequence problems
have been addressed by now?
This is the last leg of a long journey to go into production with ojb
and add another "success story" to the list.
Thanks,

Phil

-
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-25 Thread Phil Warrick
Hi Armin,

> - sequence manager, which implementation?

SequenceManagerHighLowImpl (I know that you don't suggest it with JBoss, 
but the failure scenario you mentioned a few week ago didn't see to 
apply (where a rollback causes problems).  I plan to move towards 
dbms-generated sequences, but one step at a time...

> - exhausted DataSource pool (db-connection pool, jboss)?

I use default settings for the OracleDS, should this be changed in 
oracle-service.xml?

Phil

Armin Waibel wrote:
Hi Phil,

sounds like a deadlock.

But first a few pointers to help
me in my investigation would be very welcome
- sequence manager, which implementation?
- exhausted DataSource pool (db-connection pool, jboss)?
regards,
Armin
- Original Message -
From: "Phil Warrick" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 4:46 PM
Subject: [jBoss] multiuser problems


Hi all,

I have a j2ee client app that talks to the database via jboss and ojb.
This app works fine when there is only one client talking to jboss at
a

time.  It even works fine when I create several pseudo-clients in the
same app running separate connections in their own threads (similar to
the ojb ejb stress tests).  However when I run this test with two
separate client machines, each writing to completely different sets of
objects, things silently hang in jBoss, and I cannot make any further
remote calls.  Note that there should not be a problem of simultaneous
access to the same persistent object.  I need to restart jBoss to be
up

again.

I realize that I am only giving a general description of the problem,
and I intend to investigate further so that I have (hopefully) some
stack traces instead of silent death.   But first a few pointers to
help

me in my investigation would be very welcome.

First my setup is the following:
WinNT - jBoss 3.0.6 - ojb1.0rc2 - Oracle 8.1.6
I've held off moving up to rc3/4 due to the myriad of sequence
problems

that I and numerous other Oracle users experienced with rc3.  I'm
willing to roll up my sleeves and move to rc4 if required (is it
possible that this is a bug that has been address recently -- I don't
see any bug reports quite like this).  Hopefully the sequence problems
have been addressed by now?
This is the last leg of a long journey to go into production with ojb
and add another "success story" to the list.
Thanks,

Phil

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


Something wrong with PersistentLockMapImpl class

2003-06-25 Thread 蔡博至
Hi!
Does anyone use the PersistentLockMapImpl? I get a problem when I use 
PersistentLockMapImpl for lock map.
I have two classes A and B. Their relation is non-decomposed association ,and their 
collection-descriptor be set proxy="true" each other.
Like as:
 
  
  
  
  
   
  
 
 
 
  
  
  
  
   
  
 

In my case, I use ODMG API to operate object persistence. At the same transaction , I 
first select a object of class A then select a 
object of class B and set a new value to B's currentState property. After the 
transaction finishing, the value of B's currentState did 
not be changed in database. I confirm it work if I set 
LockMapClass=org.apache.ojb.odmg.locking.InMemoryLockMapImpl in the OJB.properties 
file.Because our application has multi OJB instance at the same time, I must set 
LockMapClass=org.apache.ojb.odmg.locking.PersistentLockMapImpl.

The lock properties are 

LockManagerClass=org.apache.ojb.odmg.locking.LockManagerDefaultImpl
LockMapClass=org.apache.ojb.odmg.locking.PersistentLockMapImpl
LockTimeout=6
ImplicitLocking=true
LockAssociations=WRITE and 
ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheEmptyImpl

In my program , I new a Transaction.READ type transaction to query A and B.

I try to query B first before query A, then set a new value to B's currentState 
property. The OJB ODMG can update field of B success even 
LockMapClass=org.apache.ojb.odmg.locking.PersistentLockMapImpl.

Does anybody know why it is or tell me how to solve this problem? 


New Functionality: Oracle-style JDBC Batching

2003-06-25 Thread Matthew Baird
For all our Oracle 9i users out there:

Oracle has a special style of batching which is higher performance than normal JDBC 
batching. See http://technet.oracle.com/products/oracle9i/daily/jun07.html for more 
information.

No special configurations are required, just make sure Batching is set to on in your 
connection information (repository_database.xml)
ie. 


and use the new Oracle9i Platform setting in your build.properties
ie.

profile=oracle9i

The implementation in the PlatformOracle9iImpl uses reflection to try and find the 
Oracle specific batching methods. It will degrade gracefully to use the default JDBC 
batching if the methods are not found.

If your PreparedStatements are wrapped (ie you obtain connections from a JDBC pool in 
JBOSS) the Oracle batching will not work, as it won't find the methods. This will not 
be an issue after I check in the JCA connector, as you will use a raw connection and 
raw preparedstatements rather than from the app servers datasource (much easier to 
debug!). Just waiting for Thomas to tell me how/when to check that stuff in :)

example results:

PersistenceBroker API with Oracle style Batching
[ojb] [performance] INFO: inserting 2500 Objects: 329 msec
[ojb] [performance] INFO: updating 2500 Objects: 406 msec
[ojb] [performance] INFO: deleting 2500 Objects: 391 msec
[ojb] [performance] INFO:
[ojb] [performance] INFO: inserting 2500 Objects: 344 msec
[ojb] [performance] INFO: updating 2500 Objects: 406 msec
[ojb] [performance] INFO: deleting 2500 Objects: 375 msec

Raw JDBC with no batching
[jdbc] [performance] INFO: inserting 2500 Objects: 1188 msec
[jdbc] [performance] INFO: updating 2500 Objects: 1187 msec
[jdbc] [performance] INFO: deleting 2500 Objects: 954 msec
[jdbc] [performance] INFO:
[jdbc] [performance] INFO: inserting 2500 Objects: 1203 msec
[jdbc] [performance] INFO: updating 2500 Objects: 1171 msec
[jdbc] [performance] INFO: deleting 2500 Objects: 954 msec

OJB is no slouch ;)

cheers,
Matthew

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



Re: [jBoss] multiuser problems

2003-06-25 Thread Armin Waibel
Hi Phil,

sounds like a deadlock.
> But first a few pointers to help
> me in my investigation would be very welcome
- sequence manager, which implementation?
- exhausted DataSource pool (db-connection pool, jboss)?

regards,
Armin
- Original Message -
From: "Phil Warrick" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 4:46 PM
Subject: [jBoss] multiuser problems


> Hi all,
>
> I have a j2ee client app that talks to the database via jboss and ojb.
> This app works fine when there is only one client talking to jboss at
a
> time.  It even works fine when I create several pseudo-clients in the
> same app running separate connections in their own threads (similar to
> the ojb ejb stress tests).  However when I run this test with two
> separate client machines, each writing to completely different sets of
> objects, things silently hang in jBoss, and I cannot make any further
> remote calls.  Note that there should not be a problem of simultaneous
> access to the same persistent object.  I need to restart jBoss to be
up
> again.
>
> I realize that I am only giving a general description of the problem,
> and I intend to investigate further so that I have (hopefully) some
> stack traces instead of silent death.   But first a few pointers to
help
> me in my investigation would be very welcome.
>
> First my setup is the following:
> WinNT - jBoss 3.0.6 - ojb1.0rc2 - Oracle 8.1.6
>
> I've held off moving up to rc3/4 due to the myriad of sequence
problems
> that I and numerous other Oracle users experienced with rc3.  I'm
> willing to roll up my sleeves and move to rc4 if required (is it
> possible that this is a bug that has been address recently -- I don't
> see any bug reports quite like this).  Hopefully the sequence problems
> have been addressed by now?
>
> This is the last leg of a long journey to go into production with ojb
> and add another "success story" to the list.
>
> Thanks,
>
> Phil
>
>
> -
> 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: Sap DB

2003-06-25 Thread Kwok Peng Tuck
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]


Re: [PATCH] PersistentFieldDefaultImpl.java

2003-06-25 Thread Chris Giordano
I submitted this patch yesterday but have now put it into scarab as well.

Refer to Patch ID: OJB184

Chris Giordano
[EMAIL PROTECTED]
Chris Giordano wrote:

Greetings,

I've been working with OJB configured with Tomcat using the Java 
Security Manager and have run into a piece of code that requires the 
use of the doPrivileged API but is missing. 
In the file: 
/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDefaultImpl.java 
, the following method uses the doPrivileged API at the top of the 
function but the code in the finally block also needs to be marked as 
privileged code.  The attached file is a cvs diff that wraps the code 
in the finally block using an anonymous inner class.

public synchronized Object get(Object obj) throws MetadataException
{
   boolean before = getField().isAccessible();
   AccessController.doPrivileged(setAccessibleAction);
...
try
{
 ...
 }
 catch(...)
 {
  ...
  }
  finally
  {
  field.setAccessible(before);
   }
 }
Thanks.

Chris Giordano
[EMAIL PROTECTED]


Index: PersistentFieldDefaultImpl.java
===
RCS file: /home/cvspublic/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDefaultImpl.java,v
retrieving revision 1.16
diff -r1.16 PersistentFieldDefaultImpl.java
209c209,217
< field.setAccessible(before);
---
 

   final boolean fbefore = before;
   AccessController.doPrivileged( new PrivilegedAction() 
   {
   public Object run() 
   {
   field.setAccessible(fbefore);
   return null;
   }
   });
   

 



-
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-25 Thread Jim Shingler
I do the same thing.


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


Table
ContactPoint
ID
TypeID
EmailAddress
PhoneNumber
...

ID  TypeID  EmailAddressPhoneNumber
1   1   [EMAIL PROTECTED]
2   2   NA  123-345.6789

Type Table
ID
classOf

ID  ClassOF
1   sd.loc.Email
2   sd.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();
}
result =
broker.getClassDescriptor(Class.forName(concreteClass,

true,

Thread.currentThread().getContextClassLoader()));

//PersistenceBrokerFactory.releaseInstance(broker);
//Constructor con =
result.getZeroArgumentConstructor();
//Object oo =
ConstructorHelper.instantiate(con);


//ClassDescriptor result =
cld.getRepository().getDescriptorFor(concreteClass);
if (result == null)
{
result = cld;
}
return result;
}
catch (PBFactoryException e)
{
throw new PersistenceBrokerException(e);
}
catch (Throwable t)
{
//broker.abortTransaction();

t.printStackTrace();
}

} 
else if (concreteClassFD != null)
{
try
{
String concreteClass = (String)
row.get(concreteClassFD.getColumnName());
if (concreteClass == null ||
concreteClass.trim().length() == 0)
{
throw new PersistenceBrokerException(
"ojbConcreteClass field returned null or
0-length string");
}
else
{
concreteClass = concreteClass.trim();
}
result =
cld.getRepository().getDescriptorFor(concreteClass);
if (result == null)
{
result = cld;
}
return result;
}
catch (PBFactoryException e)
{
  

RE: moving between environments (test, stage, prod)

2003-06-25 Thread Joe Germuska
Hi, John:

We use Ant filters to make slight adjustments to the repository file 
during a build.  It works pretty well.

Joe

At 3:49 PM -0500 6/25/03, McCaffrey, John G. wrote:
That wasn't very clear...
What I mean is, as I move the app from on environment to another, how can I
configure OJB to use a different database, without having to create a copy
of the repository_user.xml, for each database (and only changing the one
line from 'test' to 'prod' for each class).
If that is the solution (multiple xml files), how do I feed a different xml
file to OJB.
In short, how are other people managing OJB properties file changes when
moving from a Test server to a Production server?
hope that makes more sense.


--
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"If nature worked that way, the universe would crash all the time." 
	--Jaron Lanier

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


Re: RE: moving between environments (test, stage, prod)

2003-06-25 Thread Ron Gallagher
John -- 

We have a need that is similar to yours.  In our situation, we're changing the schema 
attribute as we move from one level to another, or, more frequently, from one 
development environment to another.

To simplify this, we define an alias in our repository.xml file:


]>

Then, in our class mapping file, we refer to the entity.



HTH

Ron Gallagher
Atlanta, GA
[EMAIL PROTECTED]

> 
> From: "McCaffrey, John G." <[EMAIL PROTECTED]>
> Date: 2003/06/25 Wed PM 04:49:35 EDT
> To: 'OJB Users List' <[EMAIL PROTECTED]>
> Subject: RE: moving between environments (test, stage, prod)
> 
> That wasn't very clear...
> What I mean is, as I move the app from on environment to another, how can I
> configure OJB to use a different database, without having to create a copy
> of the repository_user.xml, for each database (and only changing the one
> line from 'test' to 'prod' for each class).
> 
> If that is the solution (multiple xml files), how do I feed a different xml
> file to OJB.
> 
> In short, how are other people managing OJB properties file changes when
> moving from a Test server to a Production server?
> 
> hope that makes more sense.
> -john
> 
> -Original Message-
> From: McCaffrey, John G. 
> Sent: Wednesday, June 25, 2003 3:35 PM
> To: 'OJB Users List'
> Subject: moving between environments (test, stage, prod)
> 
> 
> Sorry for the newbie question.
> How do I tell OJB to Change the prefix of the database?
> 
> I am currently working in the 'test' database, so in repository_user.xml my
> class descriptor has the table prefixed with test like this:
>  table="test.bp_cntct">
> 
> How do I tell it to change to "stage" or "Prod"?
> 
> 
> I thought that it was in the  jdbc-connection-descriptor dbAlias, but that
> didn't work.
>  
>  jcd-alias="default" 
>   default-connection="true"
>   platform="Db2"
>   jdbc-level="2.0"
>   jndi-datasource-name="jdbc/MasterFilesDB2"
>   dbalias="test"
>   eager-release="false"
>   batch-mode="false"
>   useAutoCommit="0"
>   ignoreAutoCommitExceptions="true"
>   >
> 
> Thanks for you help, 
> -John
> 
> -
> 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: web app in jboss -- where to put files?

2003-06-25 Thread Jim Shingler
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.(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.(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.(Unknown
Source)
at
org.apache.ojb.broker.metadata.MetadataManager.(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: moving between environments (test, stage, prod)

2003-06-25 Thread McCaffrey, John G.
That wasn't very clear...
What I mean is, as I move the app from on environment to another, how can I
configure OJB to use a different database, without having to create a copy
of the repository_user.xml, for each database (and only changing the one
line from 'test' to 'prod' for each class).

If that is the solution (multiple xml files), how do I feed a different xml
file to OJB.

In short, how are other people managing OJB properties file changes when
moving from a Test server to a Production server?

hope that makes more sense.
-john

-Original Message-
From: McCaffrey, John G. 
Sent: Wednesday, June 25, 2003 3:35 PM
To: 'OJB Users List'
Subject: moving between environments (test, stage, prod)


Sorry for the newbie question.
How do I tell OJB to Change the prefix of the database?

I am currently working in the 'test' database, so in repository_user.xml my
class descriptor has the table prefixed with test like this:


How do I tell it to change to "stage" or "Prod"?


I thought that it was in thejdbc-connection-descriptor dbAlias, but that
didn't work.
 


Thanks for you help, 
-John

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



moving between environments (test, stage, prod)

2003-06-25 Thread McCaffrey, John G.
Sorry for the newbie question.
How do I tell OJB to Change the prefix of the database?

I am currently working in the 'test' database, so in repository_user.xml my
class descriptor has the table prefixed with test like this:


How do I tell it to change to "stage" or "Prod"?


I thought that it was in thejdbc-connection-descriptor dbAlias, but that
didn't work.
 


Thanks for you help, 
-John

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



java.lang.StackOverflowError within ODMG

2003-06-25 Thread Peter Gaus
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 Gausjava.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 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.Connec

Still broken proxy m:n implementation

2003-06-25 Thread Edson Carlos Ericksson Richter
Hi!

I have downloaded rc4, and still not working.

My collection descriptor is:


   
   


the bean is working with
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldPropertyImpl.

The bean code for myList is like

public class MyBean implements MyInterface {
  private List data;
  public void setMyList( List newData ) { this.data = newData; }
  public List getMyList( ) { return this.data; }
}

Just it.

If I delete an element from data (ex: getMyList().remove( 0 ) ), the real
object is deleted (even with auto-update and auto-delete = "false").

Any tips? I'm still doing something wrong?

Thanks,

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


smime.p7s
Description: S/MIME cryptographic signature


Re: Foreign Key column not getting updated

2003-06-25 Thread Jakob Braeuchi
hi jason,

forgot one thing:

when you store an Acknowledgement  without a Project the projectID will 
be set to null, because no Project is associated. this happen regardless 
of auto-update in the reference-descriptor.  if projectID  is a 
primitive null is ignored (which is a bug imho leading to other problems 
:( )

hth
jakob
[EMAIL PROTECTED] wrote:

This is exactly the question I had posted below on "subobjects."  I think I am missing an understanding, but when I populated the subobject first, it placed the id into the database.  Otherwise I got within tracing:

[org.apache.ojb.broker.core.PersistenceBrokerImpl] INFO: Cascade store for this reference (RegionVO) was set to false.

JohnE



- Original Message -
From: Jason McKerr <[EMAIL PROTECTED]>
Date: Wednesday, June 25, 2003 12:20 pm
Subject: Foreign Key column not getting updated
 

Hey guys,

I'm having a problem with a nullable foreign-key column not getting
updated.
I've got a table (Acknowledgements) that has a foreign key to the
Project table.  

Now if I have all of the columns set for acknowledgements (including
projectID) all of the columns except projectID are getting set 
when I
call store().  The projectID is getting set to null.

If I comment out the reference call to Project from the 
Acknowledgementtable in my repository, the column gets set normally.

So the question is: Can I not just do an insert without a complete
object reference?  I'm doing a lot of this over serialized XML so it's
not cool to have to pass an object graph just to do an isnert on a 
minorrelated table.

Jason



---
--
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: Foreign Key column not getting updated

2003-06-25 Thread Jakob Braeuchi
hi jason,

i made some test wit references:

Person has a reference to Test. first i connect the Test from person1 to 
person2, then i add a new Test to person2.
this works when i set auto-update="true" in the reference-descriptor  !

   private void updateRef(PersistenceBroker broker)
   {
   Query query;
   Criteria crit;
   IPerson person1, person2;
   ITest testObj = null;
   crit = new Criteria();
   crit.addEqualTo("id", new Integer(1));
   query = new QueryByCriteria(Person.class, crit);
   person1 = (IPerson) broker.getObjectByQuery(query);
   testObj = person1.getTestObject();
   crit = new Criteria();
   crit.addEqualTo("id", new Integer(3));
   query = new QueryByCriteria(Person.class, crit);
   person2 = (IPerson) broker.getObjectByQuery(query);
   // connect existing TestObj of person1
   person2.setTestObject(testObj);
   broker.store(person2);
   broker.clearCache();
   crit = new Criteria();
   crit.addEqualTo("id", new Integer(3));
   query = new QueryByCriteria(Person.class, crit);
   person2 = (IPerson) broker.getObjectByQuery(query);
   testObj = person2.getTestObject();
  
   // connect to a new TestObj
   Test testObj1 = new Test();
   testObj1.setId(new Integer(77));
   testObj1.setTest("New TestObj 77");
   person2.setTestObject(testObj1);
   broker.store(person2);

-

  
...
  

 

 

 
 
 
   

hth
jakob
Jason McKerr wrote:

OK, I've done some more testing.  Basically I'm finding that

a) If the foreign key datatype is a primitive (int) it works fine, but
you can't null it
OR 

b) If it's not a primitive, the reference (reference-descriptor) object
MUST exist and be set for the foreign-key to persist.  That means I have
two choices:
1) Switch to primitives
2) do runtime checks.  As in, 
	if (fkID != null) {
		Object a = new Object();
		a.setPK(fkID);
	}
broker.store(this);

Included is the Java file (attached) and the snippet from my
repository.xml.
Thanks,

Jason

Snippet--




 
   
   
   
   
   
   
 
   
 












On Wed, 2003-06-25 at 10:11, Jakob Braeuchi wrote:
 

hi jason,

i'd prefer the wrappers. primitives are bad.
could you please provide your class and repository.
jakob

Jason McKerr wrote:

   

OK, looking at the repository.dtd file, it seems that reference
descriptors cannot be a wrapper datatype (Integer).  It must be
primitive.  Does that mean I can't have a nullable foreign key? I know
that's unusual, but it's not that unusual.
Switching to an int made it work, but now it's required.  Is there a way
around this? Using a conversion?
Jason

On Wed, 2003-06-25 at 09:20, Jason McKerr wrote:

 

Hey guys,

I'm having a problem with a nullable foreign-key column not getting
updated.
I've got a table (Acknowledgements) that has a foreign key to the
Project table.  

Now if I have all of the columns set for acknowledgements (including
projectID) all of the columns except projectID are getting set when I
call store().  The projectID is getting set to null.
If I comment out the reference call to Project from the Acknowledgement
table in my repository, the column gets set normally.
So the question is: Can I not just do an insert without a complete
object reference?  I'm doing a lot of this over serialized XML so it's
not cool to have to pass an object graph just to do an isnert on a minor
related table.
Jason



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



package org.nacse.nees.data.project ;

import org.apache.ojb.broker.query.Query;
import org.apache.ojb.broker.query.QueryByCriteria;
import org.apache.ojb.broker.PersistenceBroker;
import org.apache.log4j.Logger;
import org.nacse.nees.data.DataObjectPBroker;
import java.util.Collection;
import java.io.Serializable;
public class Acknowledgement extends DataObjectPBroker implements Serializable  {

 private Integer ackID;
 private Integer projectID;
 private String acknowledgements;
 private String sponsors;
 private Project projectRef;
 private Integer ackOptLock;
 static Logger log = Logger.getLogger(Acknowledgement.class);

 public Acknowledgement() {
 }
 public Acknowledgement(Integer ackID,
Integer projectID,
String acknowledgements,
String sponsors) {
   this.ackID = ackID;
   this.projectID = proj

Re: Foreign Key column not getting updated

2003-06-25 Thread Jason McKerr
OK, I've done some more testing.  Basically I'm finding that

a) If the foreign key datatype is a primitive (int) it works fine, but
you can't null it

OR 

b) If it's not a primitive, the reference (reference-descriptor) object
MUST exist and be set for the foreign-key to persist.  That means I have
two choices:

1) Switch to primitives
2) do runtime checks.  As in, 
if (fkID != null) {
Object a = new Object();
a.setPK(fkID);
}
broker.store(this);

Included is the Java file (attached) and the snippet from my
repository.xml.

Thanks,

Jason

Snippet--




  






  

  













On Wed, 2003-06-25 at 10:11, Jakob Braeuchi wrote:
> hi jason,
> 
> i'd prefer the wrappers. primitives are bad.
> could you please provide your class and repository.
> 
> jakob
> 
> Jason McKerr wrote:
> 
> >OK, looking at the repository.dtd file, it seems that reference
> >descriptors cannot be a wrapper datatype (Integer).  It must be
> >primitive.  Does that mean I can't have a nullable foreign key? I know
> >that's unusual, but it's not that unusual.
> >
> >Switching to an int made it work, but now it's required.  Is there a way
> >around this? Using a conversion?
> >
> >Jason
> >
> >
> >On Wed, 2003-06-25 at 09:20, Jason McKerr wrote:
> >  
> >
> >>Hey guys,
> >>
> >>I'm having a problem with a nullable foreign-key column not getting
> >>updated.
> >>
> >>I've got a table (Acknowledgements) that has a foreign key to the
> >>Project table.  
> >>
> >>Now if I have all of the columns set for acknowledgements (including
> >>projectID) all of the columns except projectID are getting set when I
> >>call store().  The projectID is getting set to null.
> >>
> >>If I comment out the reference call to Project from the Acknowledgement
> >>table in my repository, the column gets set normally.
> >>
> >>So the question is: Can I not just do an insert without a complete
> >>object reference?  I'm doing a lot of this over serialized XML so it's
> >>not cool to have to pass an object graph just to do an isnert on a minor
> >>related table.
> >>
> >>Jason
> >>
> >>
> >>
> >>
> >>-
> >>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]
package org.nacse.nees.data.project ;

import org.apache.ojb.broker.query.Query;
import org.apache.ojb.broker.query.QueryByCriteria;
import org.apache.ojb.broker.PersistenceBroker;
import org.apache.log4j.Logger;
import org.nacse.nees.data.DataObjectPBroker;

import java.util.Collection;
import java.io.Serializable;

public class Acknowledgement extends DataObjectPBroker implements Serializable  {

  private Integer ackID;
  private Integer projectID;
  private String acknowledgements;
  private String sponsors;
  private Project projectRef;
  private Integer ackOptLock;

  static Logger log = Logger.getLogger(Acknowledgement.class);

  public Acknowledgement() {
  }
  public Acknowledgement(Integer ackID,
 Integer projectID,
 String acknowledgements,
 String sponsors) {
this.ackID = ackID;
this.projectID = projectID;
this.acknowledgements = acknowledgements;
this.sponsors = sponsors;
  }

  public Integer getAckID() {
return ackID;
  }
  public void setAckID(Integer ackID) {
this.ackID = ackID;
  }
  public Integer getProjectID() {
return projectID;
  }
  public void setProjectID(Integer projectID) {
this.projectID = projectID;
  }
  public String getAcknowledgements() {
return acknowledgements;
  }
  public void setAcknowledgements(String acknowledgements) {
this.acknowledgements = acknowledgements;
  }
  public String getSponsors() {
return sponsors;
  }
  public void setSponsors(String sponsors) {
this.sponsors = sponsors;
  }
  public Project getProjectRef() {
return projectRef;
  }
  public void setProjectRef(Project projectRef) {
this.projectRef = projectRef;
  }
  public Integer getAckOptLock() {
return ackOptLock;
  }
  public void setAckOptLock(Integer ackOptLock) {
this.ackOptLock = ackOptLock;
  }

  public Collection listAllAcks() throws Exception {
Query query = new QueryByCriteria(Acknowledgement.class, null);
PersistenceBroker broker = super.getDefaultBroker();
try {
  return broker.getCollectionByQuery(query);
}
catch (Exception e) {
  log.error("Exception in listAllAcks(): ", e);
  throw new Exception("Excep

Re: Delete problem with QueryByCriteria

2003-06-25 Thread Jakob Braeuchi
hi emil,

QueryByCriteria(example) build a query based on _all_ non-null instvars of the example object whereas QueryByIdentity(example) uses the pk-values only. 

hth
jakob


Emil Alexandrov wrote:

Hi I'm new in using OJB and so far I just try to follow the examples in
tutorials.
I'm using OJB 1.0.rc3 and MySQL DB.
In my code which is copied and modified a little from tutorial1.html
section - Deleting Object I noticed the following problem.
When I use 
Query query = new QueryByCriteria(example);
to create query which will return the object that I want to delete
nothing happens.
But if I use 
Query query = new QueryByIdentity(example);
The record is found and successfully deleted.
In the example in tutorial1.html QueryByCriteria is used.
Can someone explain what I do wrong? And is there a way to see what SQL
statement is generated in both cases? 
Here is the complete code I'm using:
   public void deleteUser(int userID) {
   PersistenceBroker broker = null;
   UserData example = new UserData();
   example.setUserID(userID);
   // 2. build a QueryByCriteria from this sample instance:
   Query query = new QueryByCriteria(example);
   try
   {
   broker =
PersistenceBrokerFactory.defaultPersistenceBroker();

   // start broker transaction
   broker.beginTransaction();
   // lookup the product specified by the QBE
   UserData toBeDeleted = (UserData)
broker.getObjectByQuery(query);
   // now ask broker to delete the object
   broker.delete(toBeDeleted);
   // commit transaction
   broker.commitTransaction();
   }
   catch (Throwable t)
   {
   // rollback in case of errors
   broker.abortTransaction();
   t.printStackTrace();
   }
   }
10x
Emil
-
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: Problem In Time Stamp

2003-06-25 Thread Armin Waibel
Hi,


Hi,

- Original Message -
From: "Ramamurthy Kethappan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 6:41 AM
Subject: Problem In Time Stamp


> Hi
>   I started to work with OJB couple of days before. I am facing
problme in setting up OJB. I am getting following exception when i build
with junit.
>   Is the problem is with Timestamp mapping.
>
>

I don't know anything about oracle, but maybe this thread helps

http://www.mail-archive.com/ojb-user%40db.apache.org/msg02690.html

regards,
Armin

> [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the update (for a
org.apache.ojb.broker.LockedByTimestamp): ORA-01861: literal does not
match format string
>
> ORA-01861: literal does not match format string
>
> [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the query (for a org.apache.ojb.broker.Person):
ORA-00937: not a single-group group function
>
> ORA-00937: not a single-group group function
>
>
>
>
> 
> Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
> http://login.mail.lycos.com/r/referral?aid=27005
>
> -
> 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: A Very Serious problem -- The cursor "SQLCUR7" is not in a prepared state

2003-06-25 Thread Armin Waibel
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.(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
>
com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67
)
> at
>
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvo
ker.java:123)
> at
>
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(Cach
edInvocation.java:67)
> at
>
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(Servlet
RequestProcessor.java:122)
> at
>
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEList
ener.java:315)
> at
>
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnectio
n.java:60)
> at
>
com.ibm.ws.http.HttpConnection.readAndHa

Re: Foreign Key column not getting updated

2003-06-25 Thread Jakob Braeuchi
hi jason,

i'd prefer the wrappers. primitives are bad.
could you please provide your class and repository.
jakob

Jason McKerr wrote:

OK, looking at the repository.dtd file, it seems that reference
descriptors cannot be a wrapper datatype (Integer).  It must be
primitive.  Does that mean I can't have a nullable foreign key? I know
that's unusual, but it's not that unusual.
Switching to an int made it work, but now it's required.  Is there a way
around this? Using a conversion?
Jason

On Wed, 2003-06-25 at 09:20, Jason McKerr wrote:
 

Hey guys,

I'm having a problem with a nullable foreign-key column not getting
updated.
I've got a table (Acknowledgements) that has a foreign key to the
Project table.  

Now if I have all of the columns set for acknowledgements (including
projectID) all of the columns except projectID are getting set when I
call store().  The projectID is getting set to null.
If I comment out the reference call to Project from the Acknowledgement
table in my repository, the column gets set normally.
So the question is: Can I not just do an insert without a complete
object reference?  I'm doing a lot of this over serialized XML so it's
not cool to have to pass an object graph just to do an isnert on a minor
related table.
Jason



-
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: Sap DB

2003-06-25 Thread Jakob Braeuchi
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]


Re: Foreign Key column not getting updated

2003-06-25 Thread jeichels
This is exactly the question I had posted below on "subobjects."  I think I am missing 
an understanding, but when I populated the subobject first, it placed the id into the 
database.  Otherwise I got within tracing:

[org.apache.ojb.broker.core.PersistenceBrokerImpl] INFO: Cascade store for this 
reference (RegionVO) was set to false.

JohnE



- Original Message -
From: Jason McKerr <[EMAIL PROTECTED]>
Date: Wednesday, June 25, 2003 12:20 pm
Subject: Foreign Key column not getting updated

> Hey guys,
> 
> I'm having a problem with a nullable foreign-key column not getting
> updated.
> 
> I've got a table (Acknowledgements) that has a foreign key to the
> Project table.  
> 
> Now if I have all of the columns set for acknowledgements (including
> projectID) all of the columns except projectID are getting set 
> when I
> call store().  The projectID is getting set to null.
> 
> If I comment out the reference call to Project from the 
> Acknowledgementtable in my repository, the column gets set normally.
> 
> So the question is: Can I not just do an insert without a complete
> object reference?  I'm doing a lot of this over serialized XML so it's
> not cool to have to pass an object graph just to do an isnert on a 
> minorrelated table.
> 
> Jason
> 
> 
> 
> 
> ---
> --
> 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: Foreign Key column not getting updated

2003-06-25 Thread Jason McKerr
OK, looking at the repository.dtd file, it seems that reference
descriptors cannot be a wrapper datatype (Integer).  It must be
primitive.  Does that mean I can't have a nullable foreign key? I know
that's unusual, but it's not that unusual.

Switching to an int made it work, but now it's required.  Is there a way
around this? Using a conversion?

Jason


On Wed, 2003-06-25 at 09:20, Jason McKerr wrote:
> Hey guys,
> 
> I'm having a problem with a nullable foreign-key column not getting
> updated.
> 
> I've got a table (Acknowledgements) that has a foreign key to the
> Project table.  
> 
> Now if I have all of the columns set for acknowledgements (including
> projectID) all of the columns except projectID are getting set when I
> call store().  The projectID is getting set to null.
> 
> If I comment out the reference call to Project from the Acknowledgement
> table in my repository, the column gets set normally.
> 
> So the question is: Can I not just do an insert without a complete
> object reference?  I'm doing a lot of this over serialized XML so it's
> not cool to have to pass an object graph just to do an isnert on a minor
> related table.
> 
> Jason
> 
> 
> 
> 
> -
> 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]



Foreign Key column not getting updated

2003-06-25 Thread Jason McKerr
Hey guys,

I'm having a problem with a nullable foreign-key column not getting
updated.

I've got a table (Acknowledgements) that has a foreign key to the
Project table.  

Now if I have all of the columns set for acknowledgements (including
projectID) all of the columns except projectID are getting set when I
call store().  The projectID is getting set to null.

If I comment out the reference call to Project from the Acknowledgement
table in my repository, the column gets set normally.

So the question is: Can I not just do an insert without a complete
object reference?  I'm doing a lot of this over serialized XML so it's
not cool to have to pass an object graph just to do an isnert on a minor
related table.

Jason




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



sub objects and a question on storing

2003-06-25 Thread jeichels
Hey all,

I am new to object relational bridges and I am trying to accomplish a fairly complex 
site.   I have gotten pretty far I think looking through the demos and reading the a 
archives.  Bows especially to Thomas for the helping hand he has given people for 
quite some time.

Anyway, onto my two main questions.

Question One:  I am using PersistentNestedFieldMaxPerformanceImpl so that I can use 
"->" in the repository for nested objects.   Are there plans to incorporate this in 
with other PersistentField Attribute implementations?   Is the only difference between 
PersistentNestedFieldMaxPerformanceImpl and the default implementation that it 
accesses fields directly?



Question Two:  I have looked through the demos, but I am missing a piece of 
understanding about bridges.   I have a simple reference-descriptor in my repository 
file as shown in the code below.   I was trying to load a region based on a region id. 
 I could not figure out how to auto-load a new RegionVO if regionId alone changed or 
was about to be inserted.  This was "ok" as I knew I could manually load the new 
RegionVO object using a DAO.   But here is the problem I was having:  I would try to 
insert the LocationVO object before retrieving the RegionVO object.  Instead of just 
inserting the populated regionId into the database, it would insert try to insert null 
and would null out the regionId during store().When I got the RegionVO first 
manually and populated it, regionId would be stored correctly.  Why did I have to get 
the RegionVO first?   The debug message I got about the field is just below:

"[org.apache.ojb.broker.core.PersistenceBrokerImpl] INFO: Cascade store for this 
reference (RegionVO) was set to false."


Thanks for your wisdom!!!

JohnE





   

  

  




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



Re: Update in 1-m relationship question

2003-06-25 Thread Mykola Ostapchuk
> Mykola Ostapchuk wrote:
>
> >Hello,
> >
> >I'm having problem updating records in 1-m relationship.
> >I have 2 tables - Users and UsersRoles. 1 User can have 1-m UserRoles.
When
> >I delete user - it automatically deletes all the UserRoles - so it works
> >well. But when I update - as I understand, it should first delete all
> >UsersRoles and then insert new ones.  Now it doesn't delete - only
inserts
> >new UserRoles.
> >Should I delete all UsersRoles by myself before updating User or there's
> >something wrong with my configuration/files?
> >
> >repository.xml:
> >
> >
> >  >primarykey="true" autoincrement="true"/>
> >  >jdbc-type="VARCHAR"/>
> >  >jdbc-type="VARCHAR"/>
> >  >element-class-ref="com.name.wos.users.UsersRolesVO" auto-retrieve="true"
> >auto-update="true" auto-delete="true">
> >
> > 
> >
> >
> > >table="usersroles">
> >   >primarykey="true" autoincrement="true"/>
> >   >jdbc-type="BIGINT"/>
> >   >jdbc-type="BIGINT"/>
> >
> >
> >
> >update DAO:
> >
> > public void update(ValueObject updateRecord) throws DataAccessException
{
> >PersistenceBroker broker = null;
> >try {
> >UsersVO usersVO = (UsersVO) updateRecord;
> >broker = ServiceLocator.getInstance().findBroker();
> >broker.beginTransaction();
> >broker.store(usersVO);
> >broker.commitTransaction();
> >} catch (PersistenceBrokerException e) {
> >broker.abortTransaction();
> >e.printStackTrace();
> >throw new DataAccessException("Error in UsersDAO.update()",
e);
> >} catch (ServiceLocatorException e) {
> >throw new DataAccessException("ServiceLocatorException error
in
> >UsersDAO.update()",e);
> >} finally {
> >if (broker != null) broker.close();
> >}
> >}
> >
> >
> >UsersVO.java:
> >
> >import java.util.*;
> >import com.name.wos.common.ValueObject;
> >
> >public class UsersVO extends ValueObject {
> >
> >private Long userId;
> >private String username;
> >private String password;
> >private Vector userUR = new Vector(); // of type UsersRolesVO
> >
> >public Long getUserId() {
> >return userId;
> >}
> >public void setUserId(Long userId) {
> >this.userId = userId;
> >}
> >
> >public String getUsername() {
> >return username;
> >}
> >public void setUsername(String username) {
> >this.username = username;
> >}
> >
> >public String getPassword() {
> >return password;
> >}
> >public void setPassword(String password) {
> >this.password = password;
> >}
> >
> >public Vector getUserUR() {
> >return userUR;
> >}
> >public void setUserUR(Vector userUR) {
> >this.userUR=userUR;
> >}
> >
> >}
> >

> >
> I would try to do all the modifications to the userUR - Collection that
> is given to you by the system because it is a 'RemovalAwareCollection'.
> this would be my setUserUR method:
>
> public void setUserUR(Vector userUR) {
> this.userUR.clear();
> this.userUR.addAll(userUR);
> }
> and then persist the whole thing.
>
> Matthias Laube.
>

In setter method I'm sending as a parameter Vector of new objects of type
UsersRoles - so If you want to clear all existing UsersRoles - you can't
based on new Vector. The only way I see it - to return a Vector of existing
UserRoles based on UserID - and delete these objects. Then - insert new
ones. But I'll better do it in DAO class, not in VO's setter. What do you
think?
I'm really wondering if (or why) it isn't done automatically by OJB? It's so
common situation. I think this routine must be accomplished by OJB.

Regards,
Mykola Ostapchuk


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



Too stupid... :) or: a Bug in SqlGeneratorDefaultImpl?

2003-06-25 Thread Hinnerk Feldwisch
Hello,

after "hours" of debugging I found the problem with my m:n- mapping:
the cause of it was that I used the same name for the collection- name
and the (mysql- ) table very annoying, I should name all tables
like "table_friends" now! :/

But perhabs the SQL- code which is generated by
SqlGeneratorDefaultImpl could be made more robust? It would be nice to
know that I'm the only one who had to find the sollution for this
problem :)

Here is the crazy but  "faulty" code:
SELECT A0.password,A0.nickname,A0.gbId,A0.imageFileName, (...)
FROM USERS A0,friends INNER JOIN friends A1 ON A0.userId=A1.theUserId
INNER JOIN USERS A2 ON A1.friendId=A2.userId WHERE (A1.theUserId = 163 )
AND friendId = A0.userId

And it should be:
SELECT A0.password,A0.nickname,A0.gbId,A0.imageFileName, (...)
FROM USERS A0,friends A1 WHERE (A1.theUserId = 163 ) AND
A1.friendId = A0.userId

Thank you though for all your good work!,
Hinnerk


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



Getting the correct class instantiated

2003-06-25 Thread David . Corbin
We would like to have a table that represents 3 or 4 different classes that
share a common base class.  When objects are created out of the table, one
column in the table indicates which concrete class should be instantiated.
These objects are refered to by a handful of different classes.  I thought
this was a perfect job for a RowReader, but the RowReader example seems to
be a case of instantiating two objects out of one row, and our attempts at
variations have not met with success.

What is the correct approach to this?

David


This message contains information from Equifax Inc. which may be
confidential and privileged.  If you are not an intended recipient, please
refrain from any disclosure, copying, distribution or use of this
information and note that such actions are prohibited.  If you have
received this transmission in error, please notify by e-mail
[EMAIL PROTECTED]



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



Delete problem with QueryByCriteria

2003-06-25 Thread Emil Alexandrov
Hi I'm new in using OJB and so far I just try to follow the examples in
tutorials.
I'm using OJB 1.0.rc3 and MySQL DB.
In my code which is copied and modified a little from tutorial1.html
section - Deleting Object I noticed the following problem.
When I use 
Query query = new QueryByCriteria(example);
 to create query which will return the object that I want to delete
nothing happens.
But if I use 
Query query = new QueryByIdentity(example);
The record is found and successfully deleted.
In the example in tutorial1.html QueryByCriteria is used.
Can someone explain what I do wrong? And is there a way to see what SQL
statement is generated in both cases? 
Here is the complete code I'm using:
public void deleteUser(int userID) {
PersistenceBroker broker = null;
UserData example = new UserData();
example.setUserID(userID);
// 2. build a QueryByCriteria from this sample instance:
Query query = new QueryByCriteria(example);
try
{
broker =
PersistenceBrokerFactory.defaultPersistenceBroker();

// start broker transaction
broker.beginTransaction();
// lookup the product specified by the QBE
UserData toBeDeleted = (UserData)
broker.getObjectByQuery(query);
// now ask broker to delete the object
broker.delete(toBeDeleted);
// commit transaction
broker.commitTransaction();
}
catch (Throwable t)
{
// rollback in case of errors
broker.abortTransaction();
t.printStackTrace();
}
}

10x
Emil

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



[jBoss] multiuser problems

2003-06-25 Thread Phil Warrick
Hi all,

I have a j2ee client app that talks to the database via jboss and ojb. 
This app works fine when there is only one client talking to jboss at a 
time.  It even works fine when I create several pseudo-clients in the 
same app running separate connections in their own threads (similar to 
the ojb ejb stress tests).  However when I run this test with two 
separate client machines, each writing to completely different sets of 
objects, things silently hang in jBoss, and I cannot make any further 
remote calls.  Note that there should not be a problem of simultaneous 
access to the same persistent object.  I need to restart jBoss to be up 
again.

I realize that I am only giving a general description of the problem, 
and I intend to investigate further so that I have (hopefully) some 
stack traces instead of silent death.   But first a few pointers to help 
me in my investigation would be very welcome.

First my setup is the following:
WinNT - jBoss 3.0.6 - ojb1.0rc2 - Oracle 8.1.6
I've held off moving up to rc3/4 due to the myriad of sequence problems 
that I and numerous other Oracle users experienced with rc3.  I'm 
willing to roll up my sleeves and move to rc4 if required (is it 
possible that this is a bug that has been address recently -- I don't 
see any bug reports quite like this).  Hopefully the sequence problems 
have been addressed by now?

This is the last leg of a long journey to go into production with ojb 
and add another "success story" to the list.

Thanks,

Phil

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


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

2003-06-25 Thread Julia . Winkler
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.buildDefaultK
ey(Unknown Source)
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknow
n Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
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.(Unknown
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(InitServlet.
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.(Unknown
Source)
at org.apache.ojb.broker.metadata.MetadataManager.(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: Update in 1-m relationship question

2003-06-25 Thread Matthias Laube
Mykola Ostapchuk wrote:

Hello,

I'm having problem updating records in 1-m relationship.
I have 2 tables - Users and UsersRoles. 1 User can have 1-m UserRoles. When
I delete user - it automatically deletes all the UserRoles - so it works
well. But when I update - as I understand, it should first delete all
UsersRoles and then insert new ones.  Now it doesn't delete - only inserts
new UserRoles.
Should I delete all UsersRoles by myself before updating User or there's
something wrong with my configuration/files?
repository.xml:






   



 
 
 

update DAO:

public void update(ValueObject updateRecord) throws DataAccessException {
   PersistenceBroker broker = null;
   try {
   UsersVO usersVO = (UsersVO) updateRecord;
   broker = ServiceLocator.getInstance().findBroker();
   broker.beginTransaction();
   broker.store(usersVO);
   broker.commitTransaction();
   } catch (PersistenceBrokerException e) {
   broker.abortTransaction();
   e.printStackTrace();
   throw new DataAccessException("Error in UsersDAO.update()", e);
   } catch (ServiceLocatorException e) {
   throw new DataAccessException("ServiceLocatorException error in
UsersDAO.update()",e);
   } finally {
   if (broker != null) broker.close();
   }
   }
UsersVO.java:

import java.util.*;
import com.name.wos.common.ValueObject;
public class UsersVO extends ValueObject {

   private Long userId;
   private String username;
   private String password;
   private Vector userUR = new Vector(); // of type UsersRolesVO
   public Long getUserId() {
   return userId;
   }
   public void setUserId(Long userId) {
   this.userId = userId;
   }
   public String getUsername() {
   return username;
   }
   public void setUsername(String username) {
   this.username = username;
   }
   public String getPassword() {
   return password;
   }
   public void setPassword(String password) {
   this.password = password;
   }
   public Vector getUserUR() {
   return userUR;
   }
   public void setUserUR(Vector userUR) {
   this.userUR=userUR;
   }
}

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

I would try to do all the modifications to the userUR - Collection that 
is given to you by the system because it is a 'RemovalAwareCollection'.
this would be my setUserUR method:

   public void setUserUR(Vector userUR) {
this.userUR.clear();
this.userUR.addAll(userUR);
   }
and then persist the whole thing.
Matthias Laube.



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


Re[2]: More than one class in an OJB-OQL from clause?

2003-06-25 Thread Alexander Prozor
Hello Matthias,

Please provide example of such query :.
Please!!!

ML> Ok, I got it, was a newbie question,
ML> I couldn't imagine to query collection-attributes using the dot-notation.

ML> my feeling right now:
ML> OJB is such COOL tool.


-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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



Re: More than one class in an OJB-OQL from clause?

2003-06-25 Thread Matthias Laube
Ok, I got it, was a newbie question,
I couldn't imagine to query collection-attributes using the dot-notation.
my feeling right now:
OJB is such COOL tool.
Matthias Laube wrote:

Hi!

I don't have a really reliable OQL reference yet (anyone knows where 
to get it as the odmg.org site is down?) , but from what I know it is 
possible to have more than one class (with aliases) in the from clause 
although the result consists only of one target class. (as far as I 
know thats an OJB limitation). I only want the references to other 
classes to use them in the where clause (like a criteria for an 
attribute that is related with the target class by a m:n relation).

Is that yet possible with the OJB implemention of OQL or even with the 
PersistenceBroker API. I worked around it by using an sql Criteria but 
I don't find it optimal.

Thanks for help.
Matthias.
-
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.LogLevel=DEBUG Not used

2003-06-25 Thread Emmanuel Dupont
All,

 

Is it possible to add the Key = ODMG.LogLevel, in the load() method af the
class "OjbConfiguration".

 

If you don't use Log4j it doesn't work, you can't trace ODMG with
Level=debug by simply change the Ojb.properties.

 

I had to modify the source code..

 

 

Tx !

 



web app in jboss -- where to put files?

2003-06-25 Thread Julia . Winkler
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.buildDefaultK
ey(Unknown Source)
at
org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknow
n Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
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.(Unknown
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(InitServlet.
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.(Unknown
Source)
at org.apache.ojb.broker.metadata.MetadataManager.(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]



Newby deployment question, placement of common libraries (struts, ojb) ?

2003-06-25 Thread Claude . Glauser
Hi,

we have a J2EE application which uses ejb's, ojb and struts.
OJB and Jakarta-Struts depend (among others) on some common libraries,
i.e. commons-beanutil.jar. 

Which of the the two following solutions do you recommend ?

1. The common (=common to both, ojb and struts) libraries are placed in the
ear only once.

2. The libraries are placed in the ear file two times,
once in the WEB-INF/lib of the webapp, and once
in the root directory of the archive. 

Is there a possibility that ojb and struts will  depend
on two different versions of  the commons-libraries ?

Thanks for your advice in advance.




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



RE : How to Enable Log Trace (isDebugEnabled)

2003-06-25 Thread Emmanuel Dupont
Sorry for this stupid question. 

I found it..



-Message d'origine-
De : Emmanuel Dupont [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 25 juin 2003 10:22
À : OJB Users List
Objet : How to Enable Log Trace (isDebugEnabled)

All,

 

I would like to enable the Log debug level trace.

 

Sample I want this trace to be on : 

 

log.isDebugEnabled()) log.debug("LM.writeLock(tx-" + tx.getGUID() + ", " +
new Identity(obj, tx.getBroker()).toString() + ")");

 

 

How Can I do that and where the traces will be written ?

 



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



More than one class in an OJB-OQL from clause?

2003-06-25 Thread Matthias Laube
Hi!

I don't have a really reliable OQL reference yet (anyone knows where to 
get it as the odmg.org site is down?) , but from what I know it is 
possible to have more than one class (with aliases) in the from clause 
although the result consists only of one target class. (as far as I know 
thats an OJB limitation). I only want the references to other classes to 
use them in the where clause (like a criteria for an attribute that is 
related with the target class by a m:n relation).

Is that yet possible with the OJB implemention of OQL or even with the 
PersistenceBroker API. I worked around it by using an sql Criteria but I 
don't find it optimal.

Thanks for help.
Matthias.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problem of dynamic proxy?

2003-06-25 Thread 蔡博至
MessageHi! Jim

I have solve this problem.There is not any way to repleace Dynamic Proxy.
But I can tell you how to use "Proxy" via OJB correctly.

1. The class A there is a referance to class B , and the class-descriptor of A must be 
declared a reference-descriptor for B.
code
--
public class A{
 :
 :
 private String bOID;
 public String getBOID(){...}
 public void setBOID(String pNewValue){...} 
 
 private InterfaceB objectB;
 public InterfaceB getObjectB(){...}
 public void setObjectB(InterfaceB pNewValue){...} 
}

public class B implement InterfaceB{
 public int get**(){...}
 :
 :
}
public interface InterfaceB {
 public int get**();
  :
  :
}

repository-user content
--
 
 
 
 
:
:
:
  
  
   
  
 

 
   :
   :
   :
 


2. The class A there is a collection property that elements of collection are B, and 
you want to lazy load elements of collection when OJB load A.
code
--
public class A{
 private String OID;
 public String getOID(){...}
 public void setOID(String pNewValue){...}
 :
 :
 private Collection manyB;
 public Collection getManyB(){...}
 public void setManyB(Collection pNewValue){...}

}

public class B{
 private String aOID;
 public String getAOID(){...}
 public void setAOID(String pNewValue){...}
 
}


repository-user content
--

 
  
:
:
:
  
   
  
 

 
   :
   :
  
   :
   :
   :
 

In case 1. You must add a interface class for B and  in respository file declare 
class-descriptor for it.  Then change the setting of class A and B in respository file.
 Set the B's proxy attribute is important.

In case2. If you want to set collection propertise in your programs lazy load (like 
us), just declare the proxy attribute of 
  collction-descroptor true.

If you still have problem about lazy load(proxy), mail to me.
  - Original Message - 
  From: Jim Shingler 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, June 24, 2003 9:34 PM
  Subject: RE: Problem of dynamic proxy?


  I was reading the Archives.

  I have the exact same issue.

  Did you ever get it figured out. is there a way to solve this other than abandoning 
Dynamic Proxy?

  You response is much appreciated.

  Jim Shingler


ToDo list very empty

2003-06-25 Thread Alen Ribic
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]



Re: AW: forward-db

2003-06-25 Thread Alexander Prozor
Hello Julia,
sure, but all information about O/R mapping contains in the
repository.xml file.
JWBd> what do you mean by generating mapping from java doc comments? I thought
JWBd> this tool was for generating the repository.xml out of the java sources?



-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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



AW: forward-db

2003-06-25 Thread Julia . Winkler
Hello Alexander,

what do you mean by generating mapping from java doc comments? I thought
this tool was for generating the repository.xml out of the java sources?

Julia.

-Ursprüngliche Nachricht-
Von: Alexander Prozor [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 25. Juni 2003 10:47
An: OJB Users List
Betreff: Re: forward-db


Hello Julia,
ASAIK it don't implemented yet :(.

at http://cvs.apache.org/viewcvs/db-ojb/contrib/xdoclet-ojb-module.zip
you can get XDoclet module, that allows to generate mapping from java
doc comments.

JWBd> Hello,

JWBd> I've downloaded the latest relaese 1.0 rc3 and found in the
documentation
JWBd> (tutorial1) the tool support for foward engineering (generating SQL
DDL from
JWBd> repository.xml). But the ant target named "forward-db" is missing in
my
JWBd> build.xml. Only the reverse tool with the target "reverse-db" is
included.
JWBd> Where can I find the tool or how to write the target on my own?

JWBd> Thanks, Julia.

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



-- 
Best regards,
 Alexandermailto:[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: forward-db

2003-06-25 Thread Alexander Prozor
Hello Julia,
ASAIK it don't implemented yet :(.

at http://cvs.apache.org/viewcvs/db-ojb/contrib/xdoclet-ojb-module.zip
you can get XDoclet module, that allows to generate mapping from java
doc comments.

JWBd> Hello,

JWBd> I've downloaded the latest relaese 1.0 rc3 and found in the documentation
JWBd> (tutorial1) the tool support for foward engineering (generating SQL DDL from
JWBd> repository.xml). But the ant target named "forward-db" is missing in my
JWBd> build.xml. Only the reverse tool with the target "reverse-db" is included.
JWBd> Where can I find the tool or how to write the target on my own?

JWBd> Thanks, Julia.

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



-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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



forward-db

2003-06-25 Thread Julia . Winkler
Hello,

I've downloaded the latest relaese 1.0 rc3 and found in the documentation
(tutorial1) the tool support for foward engineering (generating SQL DDL from
repository.xml). But the ant target named "forward-db" is missing in my
build.xml. Only the reverse tool with the target "reverse-db" is included.
Where can I find the tool or how to write the target on my own?

Thanks, Julia.

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



How to Enable Log Trace (isDebugEnabled)

2003-06-25 Thread Emmanuel Dupont
All,

 

I would like to enable the Log debug level trace.

 

Sample I want this trace to be on : 

 

log.isDebugEnabled()) log.debug("LM.writeLock(tx-" + tx.getGUID() + ", " +
new Identity(obj, tx.getBroker()).toString() + ")");

 

 

How Can I do that and where the traces will be written ?