1.0-rc junit build failed for mssql

2003-03-11 Thread Anthony Kong
Hi, all,
 
The default junit test of OJB 1.0-rc targetting hsql runs perfectly and no
problem is reported.
 
However when i swtiched to mssql in build.properites, it has a lot of
failure. The build.properties file actually warned me so. 
 
However, I am interested to see if I can adopt the code in such a way that
it can test using mssql as well. Any suggestion on how I can appoarch this?
 
When targetting the mssql platform, I ecountered the following problem:
 
1) No log/trace files are found. Actually how they are defined/controlled?
 
2) At the end of broker.AllTests, I got an OutOfMemory error. I have put
-Xms -Xmx parameters to the jvmarg of the junit task, but it remains that
way. How can I solve it?
 
 
Regards,
 

Anthony
 


RE: assertFkAssignment() setting PK fields to null

2003-03-05 Thread Anthony Kong
Hi, Tim,

Thanks for your response! Thanks for drawing my attention to your email
yesterday. Acutally I have only searched the mailing list
"[EMAIL PROTECTED]" and therefore missed your mails. I should
search the both user list and development list for answer first. But, as you
know, the archive list is broken (in the db.apache.org/ojb, not in
db.apache.org though). Furthermore there is no filtering by time. So a
keyword can lead to a vast amount of posts, even though some of them are as
far back as early 2002. Very frustrated to go through them.

Back to the subject, I guess the current handling is not very reasonable
because to the user the data just mysteriously disappear. Honestly i do not
know how the use of proxy can achieve it and would like to learn more about
it. (Do you mean we should use proxy class in the class-ref field? Will it
mean more work on the user's burden? I did not use proxy before, so please
forgive my ignorance :-)  If, assuming the original author of
assertFkAssignment() think a missing referenced object means an empty FK
fields, then at least the checking must be done more throughly. We should at
least cater for the case of auto-retrieval. And if we erased the PK we will
lost the possibity of update/delete the object further in the db.


Do you think it is a good idea to repost this developer list to raise some
discussion?


Regards,


Anthony






-Original Message-
From: Tim Drury [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 12:15 PM
To: 'OJB Users List'
Subject: RE: assertFkAssignment() setting PK fields to null



I encountered this just yesterday and got my answer today.
Does anyone know if the email archives are going to be fixed
soon?

> I guess the assetFkAssignment should not set the fields in 
> class A to null in this case, because the missing of the 
> referenced object, C, is purposeful. I wonder if 
> 1) someone has encountered this before?

yes

> 2) is it a issue? or it is because i have used the 
> auto-retrieval improperly?

It seems to be the desired behavior

> 3) If it is a issue, what should be a solution? I guess the 
> function should not modify PK fields, and better still detect 
> if auto-retrieval is in effect or not.

I cheated and set auto-retrieve to true, but I think the proper
way to solve this is via a proxy.

> 4) Is it still the case in 0.9.9 and beyond. AFAIK, in 0.9.9, 
> the function assertFkAssignment is not changed at all?

This behavior happens in 0.9.9 and the latest in CVS also.  It
appears to be planned although it makes no sense to me.

-tim

Below is the email I got when I asked the same question yesterday:


Tim,

OJB after .9.7 started to set the FK to null if the actual reference
object is null at the time of storage. This behavior broke my programs
and I had to comment out that line from the assertFK...() function
inside PersistaeceBrokerSingleVM.

I suggested making this an optional trait, to be set in the repository
on the reference object, but haven't heard anything from the developers.

Caster



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



assertFkAssignment() setting PK fields to null

2003-03-05 Thread Anthony Kong
Hi, all,
 
I am still using 0.9.8, and not sure if this is still an issue in later
version of OJB. But I hope anyone with information can drop me a hint
 
I have a class, says A, which has FK reference to a number of other classes,
says B, C. Now let's say A has two fields,
 
A.Field1
A.Field2
 
Both fields are primary keys to A and are forigen keys to B and C
respectively. So in the repository.xml it is something like
 





 

class-ref="B"



 

class-ref="C"




 
 
I have turned the auto-retrieval of C off, then I hit this problem:
 
when I try to update A (says changing the value in "someOtherField") , I
dicovered that the key fields (FieldA and FieldB) are always set to null. It
is because in function assertFkAssignment() in PersistenceBrokerImpl, when a
referenced object (class C in this case) is null, the FK fields are set to
null, which happens to be primary fields as well. So the subsequent update
failed since the keys are not invalid. 
 
I guess the assetFkAssignment should not set the fields in class A to null
in this case, because the missing of the referenced object, C, is
purposeful. I wonder if 
1) someone has encountered this before?
2) is it a issue? or it is because i have used the auto-retrieval
improperly?
3) If it is a issue, what should be a solution? I guess the function should
not modify PK fields, and better still detect if auto-retrieval is in effect
or not.
4) Is it still the case in 0.9.9 and beyond. AFAIK, in 0.9.9, the function
assertFkAssignment is not changed at all?
 
 
I have simplified the case to illustrate the point. If you still like to see
the actual xml please kindly let me know.
 
 
Regards,
 
Anthony
 
 


RE: repository_user.xml, reverse-db and field indexes

2003-03-03 Thread Anthony Kong
Hi, Ricardo,

Currently I am still using 0.9.8. In 0.9.8 the first field id must start
with "1" and no hole should be allowed in the numbering of the field id's.
(i.e. must be "1, 2, 3, 4" instead of "0, 12, 23, 14").

The reverse-db currently cannot generating the field id in the proper way.
If you are using 0.9.8 or before, you would have to manually edit the id.


Regards,

Anthony

-Original Message-
From: Ricardo Tercero Lozano [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 1:45 AM
To: OJB Users List
Subject: RE: repository_user.xml, reverse-db and field indexes


New information:


Field descriptor indexes can begin with "0" (there's no complaints)
but if I put a reference-descriptor with a foreign-key id = "6",
OJB gets the bean for the previous field-id (as it starts counting with
"1").


Ricardo.




-Mensaje original-
De: Ricardo Tercero Lozano [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 03 de marzo de 2003 18:24
Para: [EMAIL PROTECTED]
Asunto: repository_user.xml, reverse-db and field indexes



I found than if list of field descriptors inside a class descriptor in
repository_user.xml
don't work properly if field indexes begin with "0" (as generated by
reverse-db) and
reference descriptors are defined for some fields. Key values were loaded
right, but
some associated beans are loaded and some not.

This behavior was found for a table with 4 references to another table (4
types of users of
class UserBean). I use OJB 0.9.9.

Ricardo.


-
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: Cannot access mailing list archive/documentation problem

2003-02-25 Thread Anthony Kong
Hi, all,

I guess I have solved the problem by myself. If I try to access mail archive
form http://db.apache.org/mail.html  then it is Ok. The list name is
[EMAIL PROTECTED]

However, if i go inside the ojb page and use the url "Mailing lists" (on the
left hand side) to access the archive, [EMAIL PROTECTED] becomes the
list name and hence the error.

I do not know whom to contact in order to fix it. If you know please kindly
forward to appropriate party. (I think someone should have noticed, because
the change form apache.org/ojb to db.apache.org has become effective for
some time already ?!)


Regards,

Anthony


-Original Message-----
From: Anthony Kong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 4:45 PM
To: '[EMAIL PROTECTED]'
Subject: Cannot access mailing list archive/documentation problem


Hi, all

1)

When I try to access the mailing list archive shown in
http://db.apache.org/ojb/mail-lists.html


I encoutnered the following errors
 

Error occurred
Required parameter "listId" or "listName" is missing or invalid 


Is everything OK with this? 

2) 

When i try to read http://db.apache.org/ojb/faq.html, I realise that the
"general" section is missing. Additionally, clicking on the url in the table
of content does not take me to the entry. I guess the anchors are invalid
(e.g. http://db.apache.org/ojb/faq.html#5 does not take me to "How to use
OJB with my RDBMS?"
 

Regards,

Anthony

-
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: QueryBySQL and update statement (Additional information)

2003-02-25 Thread Anthony Kong
Hi, all,

I have some extra information. 

The target database is MSSQL. I found that if I run the update statment in a
query analyser and then go back to my application to try again, the update
statement will be fired. It seems strange to me. Is it an expected
behaviour?

Regard,

Anthony

-Original Message-
From: Anthony Kong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 4:49 PM
To: '[EMAIL PROTECTED]'
Subject: QueryBySQL and update statement


Hi, all,

I am using 0.9.8. I try to use QueryBySQL to apply an "update" clause on a
few thousand records. I did not apply pb.getCollectionByQuery() on this sql
object because it will fire "no resultset returned" error. Fair enough. So I
did a pb.getCount(query_by_sql) instead. As far as I can see from the sql
trace, a "select count(*) from object" table is fired instead of my update
statement.

I would like to know more about how to use QueryBySQL with an "update" sql
statement.


Regards,

Anthony


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



QueryBySQL and update statement

2003-02-25 Thread Anthony Kong
Hi, all,

I am using 0.9.8. I try to use QueryBySQL to apply an "update" clause on a
few thousand records. I did not apply pb.getCollectionByQuery() on this sql
object because it will fire "no resultset returned" error. Fair enough. So I
did a pb.getCount(query_by_sql) instead. As far as I can see from the sql
trace, a "select count(*) from object" table is fired instead of my update
statement.

I would like to know more about how to use QueryBySQL with an "update" sql
statement.


Regards,

Anthony

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



Cannot access mailing list archive/documentation problem

2003-02-25 Thread Anthony Kong
Hi, all

1)

When I try to access the mailing list archive shown in
http://db.apache.org/ojb/mail-lists.html


I encoutnered the following errors
 

Error occurred
Required parameter "listId" or "listName" is missing or invalid 


Is everything OK with this? 

2) 

When i try to read http://db.apache.org/ojb/faq.html, I realise that the
"general" section is missing. Additionally, clicking on the url in the table
of content does not take me to the entry. I guess the anchors are invalid
(e.g. http://db.apache.org/ojb/faq.html#5 does not take me to "How to use
OJB with my RDBMS?"
 

Regards,

Anthony

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



RE: Cannot create database schema and test data using >build preparetutorials

2003-02-05 Thread Anthony Kong
Hi, Mehmet,

I guess the problem is exactly because you did not touch any conf files? :-)

You have to decide which sql database you will run against in the
repository_database.xml. Have you set a proper value there?

Anthony


-Original Message-
From: Mehmet D. AKIN [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 7:57 PM
To: OJB Users List
Subject: Cannot create database schema and test data using >build
preparetutorials


I just downloaded source and tried to run bin\build prepare-tutorials, 
it compiles sources but when it comes to database preparation, torque 
gives a series of nullPointerExceptions and it cannot write anything to 
database. I didnt touch any of the configuration files, I use newest 
version of ant and Java JDK1.4.1. Anyone else encountered this problem ?

Here is the some part of the exception:

--
[torque-datasql] Resolver: used database.dtd from 
org.apache.torque.engine.database.transform package
[torque-datasql] Resolver: used 
D:\tools\jakarta-ojb-0.9.8\src\schema\ojbtest-data.dtd
[torque-datasql] java.lang.NullPointerException
[torque-datasql]at 
org.apache.torque.engine.database.transform.XmlToData.startElement(XmlToData
.java:174)
[torque-datasql]at 
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.j
ava:454)
[torque-datasql]at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXML
DocumentParser.java:217)
[torque-datasql]at 
org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLNamespaceBinder.ja
va:594)
[torque-datasql]at 
org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java
:777)
[torque-datasql]at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDo
cumentFragmentScannerImpl.java:748)
[torque-datasql]at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(XMLDocumentFragmentScannerImpl.jav
a:1453)
[torque-datasql]at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume
ntFragmentScannerImpl.java:333)
[torque-datasql]at 
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)
[torque-datasql]at 
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
..
..



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




Any Idea on the source of the problem?

2003-02-05 Thread Anthony Kong
Hi, all,

When I try to call PersistenceBrokerFactory.createPersistenceBroker(), I
have encountered the a NullPointerException, and inlined is the StackTrace.
It seems like ConfigurableFactory.createNewInstance has failed. Any idea
what might be a cause?

Regards,

Anthony 

===

Annotation: Exception occurred in Request Processor 
java.lang.reflect.InvocationTargetException
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
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBroker
Instance(PersistenceBrokerFactoryDefaultImpl.java:157)
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolable
ObjectFactory.makeObject(PersistenceBrokerFactoryDefaultImpl.java:324)
at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeye
dObjectPool.java:748)
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersisten
ceBroker(PersistenceBrokerFactoryDefaultImpl.java:197)
at
org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Persi
stenceBrokerFactory.java:129)
at co.pecunia.gl.core.TMain.(TMain.java:27)
at co.pecunia.gl.core.TMain.getApp(TMain.java:39)
at
co.pecunia.gl.module.GLActionFileSystem.(GLActionFileSystem.java:30)
at
co.pecunia.gl.module.GLActionFileSystem.(GLActionFileSystem.java:25)
at
co.pecunia.gl.module.ShowGLActionAction.performAction(ShowGLActionAction.jav
a:16)
at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystem
Action.java:69)
at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:100)
at org.openide.util.Task.run(Task.java:136)
at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
Caused by: java.lang.NullPointerException
at
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance(Con
figurableFactory.java:108)
at
org.apache.ojb.broker.accesslayer.sql.SqlGeneratorFactory.createSqlGenerator
(SqlGeneratorFactory.java:78)
at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.(PersistenceBroke
rImpl.java:161)
... 18 more
rethrown as org.apache.ojb.broker.PBFactoryException: Creation of a new PB
instance failed
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBroker
Instance(PersistenceBrokerFactoryDefaultImpl.java:163)
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl$PBKeyedPoolable
ObjectFactory.makeObject(PersistenceBrokerFactoryDefaultImpl.java:324)
at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeye
dObjectPool.java:748)
at
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersisten
ceBroker(PersistenceBrokerFactoryDefaultImpl.java:197)
at
org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Persi
stenceBrokerFactory.java:129)
at co.pecunia.gl.core.TMain.(TMain.java:27)
at co.pecunia.gl.core.TMain.getApp(TMain.java:39)
at
co.pecunia.gl.module.GLActionFileSystem.(GLActionFileSystem.java:30)
at
co.pecunia.gl.module.GLActionFileSystem.(GLActionFileSystem.java:25)
at
co.pecunia.gl.module.ShowGLActionAction.performAction(ShowGLActionAction.jav
a:16)
at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystem
Action.java:69)
at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:100)
at org.openide.util.Task.run(Task.java:136)
at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:599)
Caused by: java.lang.reflect.InvocationTargetException
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
org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBroker
Instance(PersistenceBrokerFactoryDefaultImpl.java:157)
... 13 more
Caused by: java.lang.NullPointerException
at
org.apache.ojb.broker.util.factory.ConfigurableFactory.createNewInstance(Con
figurableFactory.java:108)
at
org.apache.ojb.broker.accesslayer.sql.SqlGeneratorFactory.createSqlGenerator
(SqlGeneratorFactory.java:78)
at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.(PersistenceBroke
rImpl.java:161)
... 18 more
rethrown as org.ap

RE: Tutorial 1 fails

2003-02-05 Thread Anthony Kong
Hi, dave,

The error suggested that you probably do not have a right repository*.xml.
Can you double check it and in specific try to see if
org.apache.ojb.tutorial1.Product is defined in these xml files.

Otherwise the OJB.Properties file does not have the xml file location
proper.

Regards,

Anthony

-Original Message-
From: David Warnock [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 5:54 PM
To: [EMAIL PROTECTED]
Subject: Tutorial 1 fails


Hi,

I am trying to get to grips with OJB. I am working my way through 
quickstart. I have done all the builds (and in the process sent in a 
patch for 30 depreciation warnings). Now I am running bin/tutorial1.sh

I get the errors below. Unfortunately, they don't make much sense to me 
yet. Can anyone give me some hints whether I am doing something wrong or 
if there is a problem with the project (using up to date copy from cvs).

I have run the prepare-tutorials build which seemed fine.

Thanks

Dave

[david@amos ~/dev/tools/db-ojb]$ bin/tutorial1.sh
  _  _
  __ (_)| |_
/ _\| || _ \  ~ be persistent ~
\__/| ||___/v. 0.9.9.1
/_/

Welcome to the OJB PB tutorial application


[0] List all product entries
[1] Enter a new product
[2] Edit a product entry
[3] Delete a product entry
[4] Quit Application
type in number to select a use case
1
please enter a new product
enter name: dw
enter price: 1
enter available stock: 2
[org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: 
Create new connection 
pool:org.apache.ojb.broker.metadata.JdbcConnectionDescriptor@15a0305[
   jcd-alias=default
   default-connection=true
   dbms=Hsqldb
   jdbc-level=2.0
   driver=org.hsqldb.jdbcDriver
   protocol=jdbc
   sub-protocol=hsqldb
   db-alias=../OJB
   user=sa
   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
 
sequenceDescriptor=org.apache.ojb.broker.metadata.SequenceDescriptor@6f50a8[
  sequenceManagerClass=class 
org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl
  Properties={grabSize=20}
]
]
[org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO: Rollback 
was called, do rollback on current connection 
org.hsqldb.jdbcConnection@1acd47
org.apache.ojb.tutorial1.Product not found in OJB Repository
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: 
org.apache.ojb.tutorial1.Product not found in OJB Repository
 at 
org.apache.ojb.broker.metadata.DescriptorRepository.getDescriptorFor(Descrip
torRepository.java:305)
 at 
org.apache.ojb.broker.metadata.DescriptorRepository.getDescriptorFor(Descrip
torRepository.java:318)
 at 
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.store(PersistenceBroker
Impl.java:623)
 at 
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.store(DelegatingP
ersistenceBroker.java:151)
 at 
org.apache.ojb.tutorial1.UCEnterNewProduct.apply(UCEnterNewProduct.java:42)
 at org.apache.ojb.tutorial1.Application.run(Application.java:89)
 at org.apache.ojb.tutorial1.Application.main(Application.java:57)

[0] List all product entries
[1] Enter a new product
[2] Edit a product entry
[3] Delete a product entry
[4] Quit Application
type in number to select a use case

-- 
David Warnock, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.



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