Configurable SQL Statement generation

2006-07-05 Thread Guido Beutler
Hi, I would like to generate to generate SQL select statements for DB2 in a managed environment (JBoss). All Select Statements should be extended by for read only. I found that it is possible to hardcode this at org.apache.ojb.broker.accesslayer.sql.SqlSelectStatement at buildStatement()

Configurable SQL Statement generation

2006-07-05 Thread Guido Beutler
Hi, I would like to generate to generate SQL select statements for DB2 in a managed environment (JBoss). All Select Statements should be extended by for read only. I found that it is possible to hardcode this at org.apache.ojb.broker.accesslayer.sql.SqlSelectStatement at

Re: Query about more than one table

2006-04-10 Thread Guido Beutler
should resolve 'key' to 'A0.key' amd 'otherfield' to 'A1.otherfield'. what version of ojb are you using ? inverse-foreignkeyfield-id-ref looks rather old to me ? jakob Guido Beutler schrieb: Hi Jakob, here is a sample, I can not post the original code, sorry. what I am doing I now

Re: Query about more than one table

2006-04-07 Thread Guido Beutler
Hi Jakob, here is a sample, I can not post the original code, sorry. what I am doing I now: crit.addEqualTo(key,new Integer(5)); crit.addEqualTo(table_b.otherfield,new Integer(10)); The problem now is, that key is a column in both table but the query,which is build by OJB, adds select ...

Query about more than one table

2006-04-06 Thread Guido Beutler
Hi, I have a problem building query about more than one table when the field in a where clause with OJB 1.0.4 occur in more than one table with the same name. In SQL the following would work: select * from table_a A0, table_b A1 where A0.key=A1.key and A0.key=5 ; OJB builds a query where A0

primary key field null after update

2006-04-05 Thread Guido Beutler
Hi, I am using OJB 1.0.4 inside of jboss 3.2.5. I updated from OJB 1.0.0 to 0.4 . Now I am running is a strange problem which did not occur in 1.0.0. When I update a object the primary key field is null after the store although the update is executed and succeed. The update sql statement is

Change od Schema during Runtime

2006-03-09 Thread Guido Beutler
Hello, I would like to copy complex objects from schema A to schema B. This would run in a managed environment (JBoss EJB Server) The schema is configured at the XML Mapping, can I change this during runtime like 1) read data from schema A 2) change schema 3) store the same objects to schema B

Re: ArrayIndexOutOfBoundsException at 1:N relationship

2006-02-01 Thread Guido Beutler
Hi, please forget all I wrote :) I had a error at the definition of the pk of A. A second row was defined as primary key too. I think that I ran in this problem during my tests. This maybe why the autoload was working when I started. With the invalid pk definition the test case wouldn't

Are sequence values incremented before use

2004-12-15 Thread Guido Beutler
Hi, I've got a strange problem when using sequences wir OJB 1.0.0. In some cases different applications get the same PK value but both are using the same sequence. Does OJB increment the sequence value before use? I configured the sequence at ojb as followed : sequence-manager

Transaction rollback problem

2004-10-22 Thread Guido Beutler
Hi, I use OJB 1.0.0 inside of JBoss 3.2.3. how to handle the following condition: First I try to insert a row. This fails because of one required field wasn't filled and the transaction is rolled back. After that I try to insert the same row again, this time with correct data. OJB then generates

Re: JBoss have to close connection in managed environment and nes ted EJB calls

2004-07-02 Thread Guido Beutler
Hi, I had the same problem with jboss 3.2.2 and different OJB versions. The problem was solved at jboss 3.2.3. Armin may remember or long mail threads. :-) I haven't updated to 3.2.5 yet but for me it sounds as if the same problem occurs there again. Could you make a quick check with 3.2.3 ? best

Re: Trying to return an unknown connection2!

2004-04-27 Thread Guido Beutler
TxConnectionManager...bla, bla Reached the line count for a do my best answer ;-) regards, Armin Guido Beutler wrote: Hello, I've got a strange problem with RC6 at JBoss 3.2.3. I've got a statefull and a stateless session bean. The stateless session bean contains all OJB stuff. The statefull facade

Re: Trying to return an unknown connection2!

2004-04-27 Thread Guido Beutler
changes or do you want to start this refactoring by your own? Of course I'm willing to test a fix. I'm currently a litte bit bussy too so impementing a fix on our own maybe difficult but I'll check it. thanks for the help and best regards, Guido regards, Armin Guido Beutler wrote: Hi Armin

Trying to return an unknown connection2!

2004-04-23 Thread Guido Beutler
Hello, I've got a strange problem with RC6 at JBoss 3.2.3. I've got a statefull and a stateless session bean. The stateless session bean contains all OJB stuff. The statefull facade accesses some tables via JDBC directly. That stateless session OJB bean has transaction attribute RequiresNew.

Re: Sequence Manager question

2004-04-06 Thread Guido Beutler
Hi Armin, Armin Waibel wrote: Hi, Guido Beutler wrote: NextValImpl is ok for me. There is a database sequence at the pk column which caused my problem. After setting the readonly attribute for the primary key column at the repository everything worked fine. hmm, this shouldn't work. If you

Re: Sequence Manager question

2004-04-06 Thread Guido Beutler
Hi Tom, Thomas Dudziak wrote: On Tue, 6 Apr 2004, Guido Beutler wrote: Hi Armin, Armin Waibel wrote: Hi, Guido Beutler wrote: NextValImpl is ok for me. There is a database sequence at the pk column which caused my problem. After setting the readonly attribute for the primary

Sequence Manager question

2004-04-05 Thread Guido Beutler
Hi, I use OJB RC6 and DB2. I want to insert a abject into a table with a sequence. I took the settings from documentation and added to database.xml : sequence-manager className=org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl attribute attribute-name=autoNaming

Re: Sequence Manager question

2004-04-05 Thread Guido Beutler
Hi Tom, Thomas Dudziak wrote: On Mon, 5 Apr 2004, Guido Beutler wrote: Hi, I use OJB RC6 and DB2. I want to insert a abject into a table with a sequence. I took the settings from documentation and added to database.xml : sequence-manager className

Re: Configuration problem with rc6

2004-04-03 Thread Guido Beutler
Hello, i've got a small howto question. I use PB API of OJB RC6 inside of JBoss 3.2.3 with DB2. There are applications which directly access the same data without usng OJB or ejb. My problem now is that I would like to lock some (not all) objects imediately. Normaly I use read uncommited but at

Transaction isolation OJB inside EJB's

2004-04-03 Thread Guido Beutler
Hello, i've got a small howto question. I use PB API of OJB RC6 inside of JBoss 3.2.3 with DB2. There are applications which directly access the same data without usng OJB or ejb. My problem now is that I would like to lock some (not all) objects imediately. Normaly I use read uncommited but at

Re: Configuration problem with rc6

2004-04-03 Thread Guido Beutler
Sorry wrong header Guido Beutler wrote: Hello, i've got a small howto question. I use PB API of OJB RC6 inside of JBoss 3.2.3 with DB2. There are applications which directly access the same data without usng OJB or ejb. My problem now is that I would like to lock some (not all) objects

Re: Null Value generated if auto-retrieve set to false

2004-04-01 Thread Guido Beutler
Hi Armin, works great. Thanks very much :-) As you could see from my mail I started moving from primitives to objects. Your performance argument for 1:n is a very strong one. The null value problem was a side effect of my work. best regards, Guido Armin Waibel wrote: Hi Guido, Guido Beutler

Re: Insert instead of update generated in RC6

2004-03-30 Thread Guido Beutler
Hi Armin, Armin Waibel wrote: Hi again, all ejb-example tests pass (odmg- and PB-Tests) on JBoss 3.2.2 and MaxDB. Maybe I forget to write a test for object update ;-). Do you remember our DataSource problem with 3.2.2.RC3 with missing results? Maybe that the behavior is different to JBoss

Re: Insert instead of update generated in RC6

2004-03-30 Thread Guido Beutler
Hi again, Guido Beutler wrote: Hi Armin, Armin Waibel wrote: Hi again, all ejb-example tests pass (odmg- and PB-Tests) on JBoss 3.2.2 and MaxDB. Maybe I forget to write a test for object update ;-). Do you remember our DataSource problem with 3.2.2.RC3 with missing results? Maybe

Re: Insert instead of update generated in RC6

2004-03-30 Thread Guido Beutler
Armin Waibel wrote: do you use anonymous keys? If so where? Do you remember our DataSource problem with 3.2.2.RC3 with missing results? No, can you describe this problem again? Should I update to JBoss 3.2.3 and run the tests again? we had the problem, that not all objects were returned by

Re: Insert instead of update generated in RC6

2004-03-30 Thread Guido Beutler
Guido Beutler wrote: Armin Waibel wrote: do you use anonymous keys? If so where? Do you remember our DataSource problem with 3.2.2.RC3 with missing results? No, can you describe this problem again? Should I update to JBoss 3.2.3 and run the tests again? we had the problem, that not all

Re: Insert instead of update generated in RC6

2004-03-30 Thread Guido Beutler
some small tests and can not be sure that this don't produce some side effects. If my fix is correct, updates never worked for objects with 0 values at primary key fields. best regards, Guido Guido Beutler wrote: Guido Beutler wrote: Armin Waibel wrote: do you use anonymous keys? If so

Re: Insert instead of update generated in RC6

2004-03-30 Thread Guido Beutler
be a update if already exists. This change, as far as I can see, will not change the current behaviour of OJB, right? Would work, but I still don't understand why not using conversion. best regards, Guido Just my 2 cents, Edson Richter Armin Waibel wrote: Guido Beutler wrote: Hi, changing

Re: Insert instead of update generated in RC6

2004-03-30 Thread Guido Beutler
Armin Waibel wrote: Guido Beutler wrote: Hi, changing public boolean representsNull(FieldDescriptor fld, Object aValue) { . if(((aValue instanceof Number) (((Number) aValue).longValue() == 0))) { result = fld.getPersistentField().getType().isPrimitive

Insert instead of update generated in RC6

2004-03-29 Thread Guido Beutler
Hello, I updated from RC5 to RC6. I am using OJB inside of JBoss 3.2.3 with DB2 V8. Since update to RC6 OJB generates a insert for every stored object when using PB API. OJB seems not to check if the object exists at database. If the object already exist, a SQL Exception is thrown. (-803 which

Re: Insert instead of update generated in RC6

2004-03-29 Thread Guido Beutler
Armin Waibel wrote: Hi Guido, Guido Beutler wrote: Hello, I updated from RC5 to RC6. I am using OJB inside of JBoss 3.2.3 with DB2 V8. Since update to RC6 OJB generates a insert for every stored object when using PB API. OJB seems not to check if the object exists at database

Mapping two classes two one table

2004-03-25 Thread Guido Beutler
Hi, I've got a small problem. I have a table with many columns. I would like to select only the primary key field with a complex select first. It's like a candidate list. From that I can find the correct value (independen from the database). For the correct value I would like to receive all

Re: Mapping two classes two one table

2004-03-25 Thread Guido Beutler
wrote: hi guido, use a report-query to retrieve the pks only. hth jakob Guido Beutler wrote: Hi, I've got a small problem. I have a table with many columns. I would like to select only the primary key field with a complex select first. It's like a candidate list. From that I can find the correct

Re: How to restrict result of 1:N mappings

2003-12-19 Thread Guido Beutler
, QueryByCriteria aQuery) { aQuery.getCriteria().addEqualTo(field,value); return aQuery; } The value should change dynamically. Could somebody give me a aditional hint? best regards, Guido Jakob Braeuchi wrote: hi guido, please have a look at the query customizer. jakob Guido Beutler

How to pass dynamic attribute values to QueryCustomizer Implementations

2003-12-19 Thread Guido Beutler
Hello, This is a repost with a better subject, hoping to get a hint. I build a custom QueryCustomizer implementation to restrict the retrieved values of a collection to a known primary key. I saw that I could add attributes at the deployment descriptor but the value of the primary key changes

Re: How to pass dynamic attribute values to QueryCustomizer Implementations

2003-12-19 Thread Guido Beutler
detailed. best regards, Guido -Brian On Fri, 2003-12-19 at 10:09, Guido Beutler wrote: Hello, This is a repost with a better subject, hoping to get a hint. I build a custom QueryCustomizer implementation to restrict the retrieved values of a collection to a known primary key. I saw that I

Re: How to pass dynamic attribute values to QueryCustomizerImplementations

2003-12-19 Thread Guido Beutler
thinking about this one. Any chance you can post specifics? Does value need to change while running, or is it just dependent upon something at load time? -Brian On Fri, 2003-12-19 at 10:09, Guido Beutler wrote: Hello, This is a repost with a better subject, hoping to get a hint. I build a custom

Re: How to pass dynamic attribute values to QueryCustomizer Implementations

2003-12-19 Thread Guido Beutler
Hi, Lance Eason wrote: It's entirely possible to do this, but in general I think it's a bad design *to* do it. I never said that it is the best way to do it. :-) Collection descriptors are used to model relationships, not arbitrary dynamic queries. The role of query customizers is to allow

Re: How to pass dynamic attribute values to QueryCustomizerImplementations

2003-12-19 Thread Guido Beutler
best regards, Guido Daniel. - Original Message - From: Guido Beutler [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Sent: Friday, December 19, 2003 4:07 PM Subject: Re: How to pass dynamic attribute values to QueryCustomizerImplementations Hello, for a more detailed

Order of field-descriptor id entries at repository

2003-12-18 Thread Guido Beutler
Hello, I had some stange values aut objects since updated to RC5. After some debuging I found out that I got illegal values at attributes which does not match with the database. For example I got a attribute at tahe object with the value 15 where a 0 is stored at the corresponding database row.

How to restrict result of 1:N mappings

2003-12-18 Thread Guido Beutler
Hello, I've got a 1:N mapping between classes. I would like to restrict the entries at the retrieved collection. I got two Classes A and B with a 1:n mapping between it. B has 17000 entries so I would like to restrict the collection to a small set of B's by using the primary key of B. By

Re: OJB RC4 does not select all objects?

2003-10-13 Thread Guido Beutler
problem. best regards, Guido Armin Waibel wrote: Hi Guido, On Thu, 09 Oct 2003 15:17:24 +0200, Guido Beutler [EMAIL PROTECTED] wrote: Hi Armin, just to keep the problem clear: If I run my standalone tescase (without any jboss around it) and set eager-release to true the problem occours too! Only

Re: OJB RC4 does not select all objects?

2003-10-09 Thread Guido Beutler
Waibel wrote: Hi Guido, On Wed, 08 Oct 2003 18:17:21 +0200, Guido Beutler [EMAIL PROTECTED] wrote: Hi Armin, took some time but I was able to build the testcase. snip :-) great! ... If I run the standalone testcase with eager-release=true the test fails. Only one object is selected. If I set

Re: OJB RC4 does not select all objects?

2003-10-08 Thread Guido Beutler
Hi Armin, first thanks for your support !! Armin Waibel wrote: Hi Guido, sorry for the late reply! On Mon, 06 Oct 2003 09:37:26 +0200, Guido Beutler [EMAIL PROTECTED] wrote: Hi again, because I did not get any reply for my postings I'm trying to get some information. What mean side

Re: OJB RC4 does not select all objects?

2003-10-08 Thread Guido Beutler
Hi Armin, took some time but I was able to build the testcase. snip :-) Why not all objects are selected and why without throwing any exception? Is there a workaround (instead of making a lot of primary key selects)? as I said in my previous post this can be a side-effect of eager-release,

Re: OJB RC4 does not select all objects?

2003-10-06 Thread Guido Beutler
, Armin - Original Message - From: Guido Beutler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 3:27 PM Subject: Re: OJB RC4 does not select all objects? Hi,, I tried a workaround and select all A by a loop with direct primary key access like: select

Re: OJB RC4 does not select all objects?

2003-10-02 Thread Guido Beutler
) at java.lang.reflect.Method.invoke(Method.java:324) What's that?? Seems that OJB creates a connection instead using the data source? best regards, Guido Guido Beutler wrote: Hi Armin, :-) yes I'm using eager-release = 'true' with 'false' my connection pool die's when running under load :-( I'll try 'false' just

Re: OJB RC4 does not select all objects?

2003-10-01 Thread Guido Beutler
Message Subject:OJB RC4 does not select all objects? Date: Wed, 01 Oct 2003 14:20:15 +0200 From: Guido Beutler [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Hello, I've got a strange problem. I have two Tables A and B with corresponding classes. B has a foreign key

OJB RC4 does not select all objects?

2003-10-01 Thread Guido Beutler
Hello, I've got a strange problem. I have two Tables A and B with corresponding classes. B has a foreign key to A and so I have a 1:N between A and B. A has a reference-descriptor to B and B has a collection-descriptor to A. If I try to select all instances of A i only get a few entries

OJB RC4 does not select all objects?

2003-10-01 Thread Guido Beutler
Hello, I've got a strange problem. I have two Tables A and B with corresponding classes. B has a foreign key to A and so I have a 1:N between A and B. A has a reference-descriptor to B and B has a collection-descriptor to A. If I try to select all instances of A i only get a few entries

Re: OJB RC4 does not select all objects?

2003-10-01 Thread Guido Beutler
, this can be a side-effect of the eager-release attribute when set 'true'. Did you tried to run your test with 'false'? Or is your test successful in standalone OJB? regards, Armin - Original Message - From: Guido Beutler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 01

Re: OJB RC4 does not select all objects?

2003-10-01 Thread Guido Beutler
) at java.lang.reflect.Method.invoke(Method.java:324) What's that?? Seems that OJB creates a connection instead using the data source? best regards, Guido Guido Beutler wrote: Hi Armin, :-) yes I'm using eager-release = 'true' with 'false' my connection pool die's when running under load

Re: query before commit problem

2003-09-16 Thread Guido Beutler
. regards, Armin - Original Message - From: Guido Beutler [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 1:13 PM Subject: Re: query before commit problem Hi, how to do it in managed enviroment? transaction.checkpoint() throws a not supported

Re: query before commit problem

2003-09-16 Thread Guido Beutler
Hi Charles, Charles Anthony wrote: Hi, Someone asked for this recently, and I'm afraid I was too busy to reply. No problem :-) When you lock an object (for update), it is *before* you make any changes to it. How can OJB know when to automatically flush changes to the database ? It can't; you

Re: query before commit problem

2003-09-15 Thread Guido Beutler
Hi, how to do it in managed enviroment? transaction.checkpoint() throws a not supported exception. best regards, Guido Jair da Silva Ferreira JĂșnior wrote: Hi, Thank you Thomas and Charles for your fast answers. I think I'll use transaction.checkpoint() as Charles pointed. By the way,

Deadlocks during OJB internal table access

2003-09-09 Thread Guido Beutler
Hello, I'm using OJB 1.0 rc4 inside of jboss3.2.2rc3 and db2. OJB is running into self generated deadlocks if I access ojb with concurrent ejb clients when using SequenceManagerNextValImpl As a workaround I use SequenceManagerInMemoryImpl but I think this won't work with sequences. If ojb could

Re: Deadlocks during OJB internal table access

2003-09-09 Thread Guido Beutler
Hi Armin, Armin Waibel wrote: Hi Guido, Hello, I'm using OJB 1.0 rc4 inside of jboss3.2.2rc3 and db2. OJB is running into self generated deadlocks if I access ojb with concurrent ejb clients when using SequenceManagerNextValImpl As a workaround I use SequenceManagerInMemoryImpl but I think

Re: OJB uses jdbc cursor to Update - but my cursor doesn't suppor t up date!

2003-09-03 Thread Guido Beutler
Hello Alex, I tried your fix after I debugged into the same problem. My problem is, that I can invalidate the objects but after that there still no update is executed after next access although ojb tells me: [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] DEBUG: executeUpdate :[EMAIL

Update problem at ODMG Interface inside jboss

2003-09-02 Thread Guido Beutler
Hi, I've got a problem during update of objects inside of jboss. I'm using ojb rc4 and jboss-3.2.2RC3. My code looks like: Transaction tx= _impl.currentTransaction(); tx.lock(obj, Transaction.WRITE); First time the object is inserted. Then I change a attribute of the object and

Re: NEWBIE: cannot update object with ODMG

2003-03-06 Thread Guido Beutler
Hi, - Original Message - From: Farnea Massimiliano [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 06, 2003 12:58 PM Subject: NEWBIE: cannot update object with ODMG I'm testing the ODMG layer with this example: /** * Update the Traente instance on the database

Re: OJB 0.99 writing to the database in jboss! Please help

2003-02-26 Thread Guido Beutler
Hi, I ran into the same problem. Is there a solution avail? cheers, Guido - Original Message - From: Ashraf Moosa [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Sent: Tuesday, February 18, 2003 10:09 AM Subject: OJB 0.99 writing to the database in jboss! Please help Hi, I

EJBException with OJB 0.9.7

2003-02-20 Thread Guido Beutler
Hi, I'm searching a strange error with the JBoss 3.0.4 TX layer and OJB. The applcation is working for a while and 'suddenly' JBoss throws a EJBException (see below). I'm not realy sure that this has to do with OJB, so I would like to know if anybody has seen this before. thanks, cheers, Guido

Locking exception with OJB 0.9.8 and JBoss

2003-02-11 Thread Guido Beutler
Hi, during storing an object I get following exception. I use OJB 0.9.8 and DB2 V7.2 with app driver. Any Idea whats going on? cheers, Guido 13:38:35,082 INFO [STDOUT] [org.apache.ojb.odmg.OJBJ2EE_2] INFO: 13:38:35,083 INFO [STDOUT] beginInternTransaction was called 13:38:35,150 INFO

OJB Database creation inside J2EE (JBoss)

2003-02-06 Thread Guido Beutler
the Database (JDBC Connect) should be open already. I wasn't able t find a sample, so maybe that everything is all right, I'm just not sure about that. If it is all right, why do I have to give the name of the repository.xml every time? thanks, cheers, Guido Beutler