Re: Inheritance using special attribute ojbConcreteClass issue
Thomas Dudziak wrote: I think the error comes from the XDoclet module, not from Torque. The problem is that you should not redefine the field in the subclass I haven't redefined it in the java code, so you think it should not appear in the repository xml for the subclass? The usual pattern is to define the field in the base class, and initialize it either directly on in the constructor, like so: private String ojbConcreteClass = getClass(); OK, initialization is done in a similar way in the constructor. Everything works fine with OJB and our code. As we wanted to migrate to a different data base vendor, I tried Torque to generate the required sql. It already worked some time ago, but changes to the database required different classes mapped to one table then. I will try to patch the generated repository xml manually... Bernd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB configuration problem on jboss
Hi Neil, this is a really strange error, seems that Oracle detect an objectionable number of bound variables in a prepared statement. You said that this error message doesn't arise in Resin+Oracle, thus it can't be a problem of OJB's sql generator. Does always the same error occur (same sql statement) or does it occur for different sql statements? Is the error reproduceable or does it occur random? If the error occur for different statements and arise radom, then the issue can be a concurrency problem - e.g. different threads using the same PB instance at the same time. regards, Armin Neil Jianguo Zhou wrote: Hi there, I use pure Servlet/JSP based code, not including any EJB based code, under JBoss app server. Use non-managed environment configuration same as other pure servlet container, such as Resin, but accessing database became unstable. It will sometimes throw exception: - ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query: SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound However, everything is ok under other servlet container, like Resin. The non-managed environment configuration is following: 1. In OJB.properties: - PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl - ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl - JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory 2. In repository_database.xml: jdbc-connection-descriptor jcd-alias=default default-connection=true platform=Oracle9i jdbc-level=2.0 driver=oracle.jdbc.driver.OracleDriver protocol=jdbc subprotocol=oracle dbalias=thin:@localhost:1521:orains1 username=scott password=tiger eager-release=false batch-mode=true useAutoCommit=0 ignoreAutoCommitExceptions=false object-cache class=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl attribute attribute-name=timeout attribute-value=900/ attribute attribute-name=autoSync attribute-value=true/ /object-cache connection-pool maxActive=21 validationQuery=/ sequence-manager className=org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl attribute attribute-name=grabSize attribute-value=20/ attribute attribute-name=autoNaming attribute-value=true/ attribute attribute-name=globalSequenceId attribute-value=false/ attribute attribute-name=globalSequenceStart attribute-value=1/ /sequence-manager /jdbc-connection-descriptor When I change to managed environment configuration, and run again. It throws another different exception: - ERROR [TranslationUtil] Cannot pre-load translation cache java.lang.UnsupportedOperationException: In managed environments only JTA transaction demarcation allowed This kind of error *always* occurs, not as *sometimes*, mentioned above. The managed environment configuration is following: 1. In OJB.properties: - PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl - ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl - JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory 2. In repository_database.xml: (Same as above non-managed environment configuration) Not changing any code is preferred, I want to just modify some configuration to go. Can anyone tell me how to deal with? Any comments would be very welcome. Thanks, Neil - 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: OJB configuration problem on jboss
Hi Armin, It always occurs on same sql, and be reproduceable. It seems a code error, even I doubt the prepared sql statement. However, it works fine in Resin+Oracle. Is some neccessary configurations missing? Before occurs the ORA-01008 error, there're some doubtful info in JBosss+Oracle. But there're not this kind of info in Resin+Oracle. FYI: - INFO [ObjectCacheDefaultImpl] Setup cache: [EMAIL PROTECTED],useSoftReferences=true,cachingKeyType=0,useAutoSync=true] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 7 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 7 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 176 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query: SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound thanks, Neil -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 4:29 PM To: OJB Users List Subject: Re: OJB configuration problem on jboss Hi Neil, this is a really strange error, seems that Oracle detect an objectionable number of bound variables in a prepared statement. You said that this error message doesn't arise in Resin+Oracle, thus it can't be a problem of OJB's sql generator. Does always the same error occur (same sql statement) or does it occur for different sql statements? Is the error reproduceable or does it occur random? If the error occur for different statements and arise radom, then the issue can be a concurrency problem - e.g. different threads using the same PB instance at the same time. regards, Armin Neil Jianguo Zhou wrote: Hi there, I use pure Servlet/JSP based code, not including any EJB based code, under JBoss app server. Use non-managed environment configuration same as other pure servlet container, such as Resin, but accessing database became unstable. It will sometimes throw exception: - ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query: SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound However, everything is ok under other servlet container, like Resin. The non-managed environment configuration is following: 1. In OJB.properties: - PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl - ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl - JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory 2. In repository_database.xml: jdbc-connection-descriptor jcd-alias=default default-connection=true platform=Oracle9i jdbc-level=2.0 driver=oracle.jdbc.driver.OracleDriver protocol=jdbc subprotocol=oracle dbalias=thin:@localhost:1521:orains1 username=scott password=tiger eager-release=false batch-mode=true useAutoCommit=0 ignoreAutoCommitExceptions=false object-cache class=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl attribute attribute-name=timeout attribute-value=900/ attribute attribute-name=autoSync attribute-value=true/ /object-cache connection-pool maxActive=21 validationQuery=/ sequence-manager className=org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl attribute attribute-name=grabSize attribute-value=20/ attribute attribute-name=autoNaming attribute-value=true/ attribute attribute-name=globalSequenceId attribute-value=false/ attribute attribute-name=globalSequenceStart attribute-value=1/ /sequence-manager /jdbc-connection-descriptor When I change to managed environment configuration, and run again. It throws another different exception: - ERROR [TranslationUtil] Cannot pre-load translation cache java.lang.UnsupportedOperationException: In managed environments only JTA transaction demarcation allowed This kind of error *always* occurs, not as *sometimes*, mentioned above. The managed environment configuration is following: 1. In OJB.properties: - PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl - ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryManagedImpl - JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory 2. In repository_database.xml: (Same as above non-managed environment configuration) Not changing any code is
Re: Inheritance using special attribute ojbConcreteClass issue
On 10/26/05, Bernd Laengerich [EMAIL PROTECTED] wrote: Thomas Dudziak wrote: I think the error comes from the XDoclet module, not from Torque. The problem is that you should not redefine the field in the subclass I haven't redefined it in the java code, so you think it should not appear in the repository xml for the subclass? Oh, yes, I missed the BaseB part. So you're mapping unrelated inheritance hierarchies onto the same table ? I'm not sure whether that works in all instances (think: queries for the base classes, collections that refer to one of the base classes), but if you say that OJB works without problems, then all the better. As for the error message, for now you can turn off the XDoclet check using the checks attribute as described here: http://db.apache.org/ojb/docu/guides/xdoclet-module.html#Usage Please be so kind and add an issue for this in OJB's JIRA, attaching the sample source code and error message/stack trace. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: proxy question
On 10/26/05, Warner Onstine [EMAIL PROTECTED] wrote: Ok, I'm working on implementing the custom proxy class and am having some issues. When I try and use my custom Proxy class I get the following: Unable to create proxy using class:org.kuali.module.chart.bo.AccountProxy AccountProxy extends the VirtualProxy class and implements my interface that I want. I also added in the following constructor: public AccountProxy(IndirectionHandler handler) { super(handler); } After I initially got the error message. In the docs it references another constructor that accepts an Identity and PersistenceBroker, but this no longer seems to be the right way to do this, is this correct? In the unit tests there is an example of such a proxy: http://cvs.apache.org/viewcvs.cgi/db-ojb/src/test/org/apache/ojb/broker/ProductGroupProxy.java?rev=1.5.2.3view=markup I haven't checked the docs, but if you say that there are no longer valid, please add an issue to OJB's JIRA so that we do not forget to update them for the next release. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Informix + SequenceManagerHighLowImpl
Hello there, we use in one case Informix and the org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl as the sequence manager. First it seemed good but then we must realize that we can't create a new record, if we didn't create a record in the rdbms before using OJB. So if we want to create a new record over OJB we have to create a record in a certain table before so that at least one PK exist. After that OJB is able to create the autoincrement keys. I know it's weird. At the moment I have no ideas because I don't know how this sequence manager works. Any suggestions are welcome! :) Regards, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB configuration problem on jboss
Neil Jianguo Zhou wrote: Hi Armin, It always occurs on same sql, and be reproduceable. It seems a code error, even I doubt the prepared sql statement. However, it works fine in Resin+Oracle. Is the statement generated by OJB or by a user query (if so please post it)? Does batch-mode=false setting influence the issue? Does setting ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl influence the issue? Do you use shared libraries (e.g. commons-dbcp) or do you bundle all libraries in the webApp (.war file)? Is some neccessary configurations missing? I don't notice a configuration error in your settings. The java.lang.UnsupportedOperationException in managed configuration (I assume) is a result of using OJB's transaction demarcation (e.g. PB.beginTransaction call) instead of using JTA-transaction demarcation. regards, Armin Before occurs the ORA-01008 error, there're some doubtful info in JBosss+Oracle. But there're not this kind of info in Resin+Oracle. FYI: - INFO [ObjectCacheDefaultImpl] Setup cache: [EMAIL PROTECTED],useSoftReferences=true,cachingKeyType=0,useAutoSync=true] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 7 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 7 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 176 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query: SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound thanks, Neil -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 4:29 PM To: OJB Users List Subject: Re: OJB configuration problem on jboss Hi Neil, this is a really strange error, seems that Oracle detect an objectionable number of bound variables in a prepared statement. You said that this error message doesn't arise in Resin+Oracle, thus it can't be a problem of OJB's sql generator. Does always the same error occur (same sql statement) or does it occur for different sql statements? Is the error reproduceable or does it occur random? If the error occur for different statements and arise radom, then the issue can be a concurrency problem - e.g. different threads using the same PB instance at the same time. regards, Armin Neil Jianguo Zhou wrote: Hi there, I use pure Servlet/JSP based code, not including any EJB based code, under JBoss app server. Use non-managed environment configuration same as other pure servlet container, such as Resin, but accessing database became unstable. It will sometimes throw exception: - ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query: SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound However, everything is ok under other servlet container, like Resin. The non-managed environment configuration is following: 1. In OJB.properties: - PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl - ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl - JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory 2. In repository_database.xml: jdbc-connection-descriptor jcd-alias=default default-connection=true platform=Oracle9i jdbc-level=2.0 driver=oracle.jdbc.driver.OracleDriver protocol=jdbc subprotocol=oracle dbalias=thin:@localhost:1521:orains1 username=scott password=tiger eager-release=false batch-mode=true useAutoCommit=0 ignoreAutoCommitExceptions=false object-cache class=org.apache.ojb.broker.cache.ObjectCacheDefaultImpl attribute attribute-name=timeout attribute-value=900/ attribute attribute-name=autoSync attribute-value=true/ /object-cache connection-pool maxActive=21 validationQuery=/ sequence-manager className=org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl attribute attribute-name=grabSize attribute-value=20/ attribute attribute-name=autoNaming attribute-value=true/ attribute attribute-name=globalSequenceId attribute-value=false/ attribute attribute-name=globalSequenceStart attribute-value=1/ /sequence-manager /jdbc-connection-descriptor When I change to managed environment configuration, and run again. It throws another different exception: - ERROR [TranslationUtil] Cannot pre-load translation cache java.lang.UnsupportedOperationException: In managed environments only JTA
Re: Informix + SequenceManagerHighLowImpl
Hi Thomas, Thomas Franke wrote: Hello there, we use in one case Informix and the org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl as the sequence manager. First it seemed good but then we must realize that we can't create a new record, if we didn't create a record in the rdbms before using OJB. So if we want to create a new record over OJB we have to create a record in a certain table before so that at least one PK exist. After that OJB is able to create the autoincrement keys. I know it's weird. Does OJB cause an error? Could you post the whole stack trace? At the moment I have no ideas because I don't know how this sequence manager works. Any suggestions are welcome! :) Have a look in method SequenceManagerHighLowImpl#lookupStoreSequence(PersistenceBroker broker, FieldDescriptor field, String seqName) this method is called to store/lookup a HighLowSequence instance. OJB first lookup a HighLowSequence instance from DB based on the sequence name. If not found OJB try to read the max key of the target column (using: SELECT MAX(column) FROM table). The returned value is used as start value for the new HighLowSequence object. OJB obtain a new PB instance (separate connection) to store/update the HighLowSequence object to avoid problems on rollback of tx of the main PB instance. regards, Armin Regards, Thomas - 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: Informix + SequenceManagerHighLowImpl
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Armin, Have a look in method SequenceManagerHighLowImpl#lookupStoreSequence(PersistenceBroker broker, FieldDescriptor field, String seqName) this method is called to store/lookup a HighLowSequence instance. OJB first lookup a HighLowSequence instance from DB based on the sequence name. If not found OJB try to read the max key of the target column (using: SELECT MAX(column) FROM table). The returned value is used as start value for the new HighLowSequence object. OJB obtain a new PB instance (separate connection) to store/update the HighLowSequence object to avoid problems on rollback of tx of the main PB instance. Thanks for your quick answer. I'll take a look. Regards, Thomas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (MingW32) Comment: GnuPT 2.6.2.1 by EQUIPMENTE.DE Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDX3FDJ9/BHYFfmhMRAuB/AJ4um2iU5yZyJM5EqKWIJnboicBjpACgjHM2 zkCXjmljID9WyMNiwCaOPBg= =2IGh -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using OJB with Oracle Packages and Procedures - simple Question
Hello people! I'm creating a app for a mobile phone/PDA's/Palms. This app connect to a servlet server and uses request/response to send/get the information. The client is an AWT frame. In the server, I'm using Struts to control my servlets and I'm thinking about to use OJB to control my DAO's. But I have to work with PKG's/PRC's from Oracle. Can I do that with OJB? Is that recomended from you guys? Thanks for your's attention. (Sorry my english..) -- Fernando Bernardino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.lang.Integer not found in OJB Repository
No one knows what could be causing this error? -Original Message- From: Lemke, Wesley [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 25, 2005 12:53 PM To: OJB Users List Subject: java.lang.Integer not found in OJB Repository I am receiving the following error: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) I have seen a few other report a similar error on this list, but the solutions for them, didn't seem relevant to me. The strange thing is that I can save a StateDiscountUpdater, but I am receiving the above error when I try to delete one. Any ideas on what I am doing wrong? Here is the relevant portion of the repository file: class-descriptor class=com.lmig.pm.affinity.service.DiscountUpdater extent-class class-ref=com.lmig.pm.affinity.service.StateDiscountUpdater / extent-class class-ref=com.lmig.pm.affinity.service.IndustryDiscountUpdater / /class-descriptor !-- StateDiscountUpdater ***-- class-descriptor class=com.lmig.pm.affinity.service.StateDiscountUpdater table=DEXA800T field-descriptor name=objectId column=NEW_ID jdbc-type=INTEGER primarykey=true autoincrement=true access=readonly / ... collection-descriptor name=discountsToUpdate element-class-ref=com.lmig.pm.affinity.service.DiscountToUpdate auto-delete=true auto-update=true inverse-foreignkey field-ref=discountUpdaterId / /collection-descriptor ... /class-descriptor !-- IndustryDiscountUpdater ***-- class-descriptor class=com.lmig.pm.affinity.service.IndustryDiscountUpdater table=DEXA800T field-descriptor name=objectId column=NEW_ID jdbc-type=INTEGER primarykey=true autoincrement=true access=readonly / ... collection-descriptor name=discountsToUpdate element-class-ref=com.lmig.pm.affinity.service.DiscountToUpdate auto-delete=true auto-update=true inverse-foreignkey field-ref=discountUpdaterId / /collection-descriptor ... /class-descriptor !-- DiscountToUpdate **-- class-descriptor class=com.lmig.pm.affinity.service.DiscountToUpdate table=DEXA810T field-descriptor name=objectId column=ORIG_ID jdbc-type=INTEGER primarykey=true autoincrement=true access=readonly / field-descriptor name=discountId column=discount_id jdbc-type=INTEGER / field-descriptor name=discountUpdaterId column=NEW_ID jdbc-type=INTEGER access=anonymous / reference-descriptor name=discountUpdater class-ref=com.lmig.pm.affinity.service.DiscountUpdater foreignkey field-ref=discountUpdaterId/ /reference-descriptor ... /class-descriptor Here is the complete stack trace: [10/25/05 12:36:21:490 CDT] 6a3f6a3f SystemErr R com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/25/05 12:36:21:490 CDT] 6a3f6a3f BaseRuntimeEx W com.lmig.pm.affinity.exception.BaseRuntimeException com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/25/05 12:36:24:715 CDT] 6a3f6a3f BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler ***There was an error [10/25/05 12:36:24:745 CDT] 6a3f6a3f BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository)
Re: java.lang.Integer not found in OJB Repository
Hi Wes, seems OJB get the PK object instead the persistent object to delete. Could you compile the ojb.jar with debug 'on' (call ant jar-debug in OJB's base directory) so that we get line numbers in stack trace. regards, Armin Lemke, Wesley wrote: No one knows what could be causing this error? -Original Message- From: Lemke, Wesley [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 25, 2005 12:53 PM To: OJB Users List Subject: java.lang.Integer not found in OJB Repository I am receiving the following error: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) I have seen a few other report a similar error on this list, but the solutions for them, didn't seem relevant to me. The strange thing is that I can save a StateDiscountUpdater, but I am receiving the above error when I try to delete one. Any ideas on what I am doing wrong? Here is the relevant portion of the repository file: class-descriptor class=com.lmig.pm.affinity.service.DiscountUpdater extent-class class-ref=com.lmig.pm.affinity.service.StateDiscountUpdater / extent-class class-ref=com.lmig.pm.affinity.service.IndustryDiscountUpdater / /class-descriptor !-- StateDiscountUpdater ***-- class-descriptor class=com.lmig.pm.affinity.service.StateDiscountUpdater table=DEXA800T field-descriptor name=objectId column=NEW_ID jdbc-type=INTEGER primarykey=true autoincrement=true access=readonly / ... collection-descriptor name=discountsToUpdate element-class-ref=com.lmig.pm.affinity.service.DiscountToUpdate auto-delete=true auto-update=true inverse-foreignkey field-ref=discountUpdaterId / /collection-descriptor ... /class-descriptor !-- IndustryDiscountUpdater ***-- class-descriptor class=com.lmig.pm.affinity.service.IndustryDiscountUpdater table=DEXA800T field-descriptor name=objectId column=NEW_ID jdbc-type=INTEGER primarykey=true autoincrement=true access=readonly / ... collection-descriptor name=discountsToUpdate element-class-ref=com.lmig.pm.affinity.service.DiscountToUpdate auto-delete=true auto-update=true inverse-foreignkey field-ref=discountUpdaterId / /collection-descriptor ... /class-descriptor !-- DiscountToUpdate **-- class-descriptor class=com.lmig.pm.affinity.service.DiscountToUpdate table=DEXA810T field-descriptor name=objectId column=ORIG_ID jdbc-type=INTEGER primarykey=true autoincrement=true access=readonly / field-descriptor name=discountId column=discount_id jdbc-type=INTEGER / field-descriptor name=discountUpdaterId column=NEW_ID jdbc-type=INTEGER access=anonymous / reference-descriptor name=discountUpdater class-ref=com.lmig.pm.affinity.service.DiscountUpdater foreignkey field-ref=discountUpdaterId/ /reference-descriptor ... /class-descriptor Here is the complete stack trace: [10/25/05 12:36:21:490 CDT] 6a3f6a3f SystemErr R com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/25/05 12:36:21:490 CDT] 6a3f6a3f BaseRuntimeEx W com.lmig.pm.affinity.exception.BaseRuntimeException com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/25/05 12:36:24:715 CDT] 6a3f6a3f BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler ***There was an error [10/25/05 12:36:24:745 CDT] 6a3f6a3f BaseException E
RE: java.lang.Integer not found in OJB Repository
Here is the entire stack trace with line numbers (this is OJB 1.0.2): [10/26/05 10:18:21:951 CDT] 29592959 SystemErr R com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:18:21:951 CDT] 29592959 BaseRuntimeEx W com.lmig.pm.affinity.exception.BaseRuntimeException com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:18:22:021 CDT] 29592959 BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler ***There was an error [10/26/05 10:18:22:041 CDT] 29592959 BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:18:22:041 CDT] 29592959 SystemErr R com.lmig.pm.affinity.exception.SystemException: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:18:22:051 CDT] 29592959 SystemErr Rat java.lang.Throwable.init(Throwable.java) [10/26/05 10:18:22:051 CDT] 29592959 SystemErr Rat java.lang.Throwable.init(Throwable.java) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.lmig.pm.affinity.exception.BaseRuntimeException.init(BaseRuntimeEx ception.java:85) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.lmig.pm.affinity.persistence.PersistenceManager.delete(PersistenceMa nager.java:1356) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.lmig.pm.affinity.service.DiscountUpdater.complete(DiscountUpdater.ja va) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.lmig.pm.affinity.action.FinishClientScheduleDiscountUpdatesAction.do Perform(FinishClientScheduleDiscountUpdatesAction.java:74) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.lmig.pm.affinity.action.AffinityAction.execute(AffinityAction.java:1 62) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:484) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.lmig.pm.affinity.servlet.ActionServlet.doGet(ActionServlet.java:49) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat javax.servlet.http.HttpServlet.service(HttpServlet.java:740) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat javax.servlet.http.HttpServlet.service(HttpServlet.java:853) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictSe rvletInstance.java:110) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLi fecycleServlet.java:174) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycle Servlet.java:313) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLif ecycleServlet.java:116) [10/26/05 10:18:22:061 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance. java:283) [10/26/05 10:18:22:071 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(Vali dServletReferenceState.java:42) [10/26/05 10:18:22:071 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(Servle tInstanceReference.java:40) [10/26/05 10:18:22:071 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispa tch(WebAppRequestDispatcher.java:948) [10/26/05 10:18:22:071 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRe questDispatcher.java:530) [10/26/05 10:18:22:071 CDT] 29592959 SystemErr Rat com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppReq uestDispatcher.java:176) [10/26/05
Re: Inheritance using special attribute ojbConcreteClass issue
On 10/26/05, Bernd Laengerich [EMAIL PROTECTED] wrote: As for the error message, for now you can turn off the XDoclet check using the checks attribute as described here:# It's not XDoclet complaining, but Torque, so is this a Torque issue? The error message and stack trace (with -debug) is: Might be either the XDoclet module or Torque. Could you post the generated repository file ? Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.lang.Integer not found in OJB Repository
Sorry, I didn't get the debug jar in the right directory. Here is the correct stack trace, and it really has the line number this time! [10/26/05 10:55:53:579 CDT] 2650265 BaseRuntimeEx W com.lmig.pm.affinity.exception.BaseRuntimeException com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:579 CDT] 2650265 SystemErr R com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:629 CDT] 2650265 BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler ***There was an error [10/26/05 10:55:53:639 CDT] 2650265 BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:649 CDT] 2650265 SystemErr R com.lmig.pm.affinity.exception.SystemException: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat java.lang.Throwable.init(Throwable.java) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat java.lang.Throwable.init(Throwable.java) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.exception.BaseRuntimeException.init(BaseRuntimeEx ception.java:85) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.persistence.PersistenceManager.delete(PersistenceMa nager.java:1356) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.service.DiscountUpdater.complete(DiscountUpdater.ja va) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.action.FinishClientScheduleDiscountUpdatesAction.do Perform(FinishClientScheduleDiscountUpdatesAction.java:74) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.action.AffinityAction.execute(AffinityAction.java:1 62) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:484) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.servlet.ActionServlet.doGet(ActionServlet.java:49) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat javax.servlet.http.HttpServlet.service(HttpServlet.java:740) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat javax.servlet.http.HttpServlet.service(HttpServlet.java:853) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictSe rvletInstance.java:110) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLi fecycleServlet.java:174) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycle Servlet.java:313) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLif ecycleServlet.java:116) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance. java:283) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(Vali dServletReferenceState.java:42) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(Servle tInstanceReference.java:40) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispa tch(WebAppRequestDispatcher.java:948) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRe questDispatcher.java) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat
Re: java.lang.Integer not found in OJB Repository
Lemke, Wesley wrote: Sorry, I didn't get the debug jar in the right directory. Here is the correct stack trace, and it really has the line number this time! The most important part of the stack trace seems to be org.apache.ojb.broker.core.PersistenceBrokerImpl.deleteCollections(Persi stenceBrokerImpl.java:692) The associated code is: snip if (cds.getCascadingDelete() == ObjectReferenceDescriptor.CASCADE_OBJECT) { Object col = cds.getPersistentField().get(obj); if (col != null) { Iterator colIterator = BrokerHelper.getCollectionIterator(col); while (colIterator.hasNext()) { doDelete(colIterator.next()); // line 692 } } } /snip The colIterator.next() return an Integer object instead of the persistent object to delete. So it seems that the populated 1:n reference in StateDiscountUpdater contains Integer objects instead of DiscountToUpdate objects. Could you check this with a debugger? regards, Armin [10/26/05 10:55:53:579 CDT] 2650265 BaseRuntimeEx W com.lmig.pm.affinity.exception.BaseRuntimeException com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:579 CDT] 2650265 SystemErr R com.lmig.pm.affinity.exception.SystemException occurred. Reason: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:629 CDT] 2650265 BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler ***There was an error [10/26/05 10:55:53:639 CDT] 2650265 BaseException E com.lmig.pm.affinity.exception.BaseExceptionHandler Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:649 CDT] 2650265 SystemErr R com.lmig.pm.affinity.exception.SystemException: Error deleting object class com.lmig.pm.affinity.service.StateDiscountUpdater (caused by: org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: java.lang.Integer not found in OJB Repository) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat java.lang.Throwable.init(Throwable.java) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat java.lang.Throwable.init(Throwable.java) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.exception.BaseRuntimeException.init(BaseRuntimeEx ception.java:85) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.persistence.PersistenceManager.delete(PersistenceMa nager.java:1356) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.service.DiscountUpdater.complete(DiscountUpdater.ja va) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.action.FinishClientScheduleDiscountUpdatesAction.do Perform(FinishClientScheduleDiscountUpdatesAction.java:74) [10/26/05 10:55:53:659 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.action.AffinityAction.execute(AffinityAction.java:1 62) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:484) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.lmig.pm.affinity.servlet.ActionServlet.doGet(ActionServlet.java:49) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat javax.servlet.http.HttpServlet.service(HttpServlet.java:740) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat javax.servlet.http.HttpServlet.service(HttpServlet.java:853) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictSe rvletInstance.java:110) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLi fecycleServlet.java:174) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycle Servlet.java:313) [10/26/05 10:55:53:669 CDT] 2650265 SystemErr Rat com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLif ecycleServlet.java:116) [10/26/05 10:55:53:669 CDT] 2650265
Re: proxy question
Well, I was hoping that that would do the trick but no dice. I'm still getting the error that it cannot create a proxy using my proxy class. org.springframework.orm.ojb.OjbOperationException: OJB operation failed; nested exception is org.apache.ojb.broker.PersistenceBrokerException: Unable to create proxy using class:org.kuali.module.chart.bo.AccountProxy org.apache.ojb.broker.PersistenceBrokerException: Unable to create proxy using class:org.kuali.module.chart.bo.AccountProxy at org.apache.ojb.broker.core.proxy.VirtualProxy.createProxy(VirtualProxy.java:123) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObject(QueryReferenceBroker.java:549) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(QueryReferenceBroker.java:393) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(QueryReferenceBroker.java:447) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.java:1454) at org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(PersistenceBrokerImpl.java:1537) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObject(QueryReferenceBroker.java:559) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(QueryReferenceBroker.java:393) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(QueryReferenceBroker.java:447) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.java:1454) at org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(PersistenceBrokerImpl.java:1537) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObject(QueryReferenceBroker.java:559) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(QueryReferenceBroker.java:393) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(QueryReferenceBroker.java:447) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.java:1454) at org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(PersistenceBrokerImpl.java:1537) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObject(QueryReferenceBroker.java:559) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(QueryReferenceBroker.java:393) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(QueryReferenceBroker.java:447) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.java:1454) at org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(PersistenceBrokerImpl.java:1537) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObject(QueryReferenceBroker.java:559) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(QueryReferenceBroker.java:393) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(QueryReferenceBroker.java:447) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl.java:1454) at org.apache.ojb.broker.core.PersistenceBrokerImpl.doGetObjectByIdentity(PersistenceBrokerImpl.java:1537) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObject(QueryReferenceBroker.java:559) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(QueryReferenceBroker.java:393) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(QueryReferenceBroker.java:447) at org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:480) at org.apache.ojb.broker.accesslayer.RsIterator.next(RsIterator.java:275) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getObjectByQuery(PersistenceBrokerImpl.java:1636) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(DelegatingPersistenceBroker.java:307) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getObjectByQuery(DelegatingPersistenceBroker.java:307) at org.springframework.orm.ojb.PersistenceBrokerTemplate$2.doInPersistenceBroker(PersistenceBrokerTemplate.java:208) at org.springframework.orm.ojb.PersistenceBrokerTemplate.execute(PersistenceBrokerTemplate.java:167) at org.springframework.orm.ojb.PersistenceBrokerTemplate.getObjectByQuery(PersistenceBrokerTemplate.java:206) at org.kuali.core.dao.ojb.KualiUserDaoOjb.getUser(KualiUserDaoOjb.java:69) at org.kuali.core.service.impl.KualiUserServiceImpl.getUser(KualiUserServiceImpl.java:51) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at
Re: proxy question
On 10/26/05, Warner Onstine [EMAIL PROTECTED] wrote: Well, I was hoping that that would do the trick but no dice. I'm still getting the error that it cannot create a proxy using my proxy class. snip Caused by: java.lang.NoSuchMethodException: org.kuali.module.chart.bo.AccountProxy.init(java.lang.reflect.InvocationHandler) at java.lang.Class.getConstructor0(Class.java:1937) at java.lang.Class.getDeclaredConstructor(Class.java:1301) at org.apache.ojb.broker.core.proxy.VirtualProxy.createProxy(VirtualProxy.java:116) I have now implemented the following constructors (and the Serializable interface per the unit test): public AccountProxy(){ super(); } public AccountProxy(PBKey key, Identity uniqueId) { super(key, uniqueId); } public AccountProxy(IndirectionHandler handler) { super(handler); } Any other ideas? Could it be that you have some classpath problem there ? The exception (and the corresponding source code of VirtualProxy) state that a constructor with a single argument of IndirectionHandler is searched for in your class, but could not be found. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Foreign key not set
Hello, I'am having trouble trying to find out what i am doing wrong, i have a class user and a class role and a user has a collection of roles, this kind of schema is working for other classes with the same kind of relationship but not for this one. OJB is trying to insert a null value in the column of the foreign key id, but the role is in the collection of roles of the user instance. I'am using latest CVS OJB, my two classes are : public class User implements INamable { /** * @ojb.field primarykey=true */ private String id; */** * @ojb.collection element-class-ref=org.jys.clepsydra.data.users.Role * foreignkey=userId auto-delete=true */ private ListRole roles = new VectorRole(); * /** * @ojb.field */ private String url; public User(String name) { this.name = name; } public User() { super(); } /** * @return Returns the roles. */ public ListRole getRoles() { return roles; } /** * @param role * @throws DataIntegrityException */ public void addRole(final Role role) throws DataIntegrityException { if (findRole(role.getDocumentBase()) != null) { throw new DataIntegrityException(this + already has a role for + role.getDocumentBase()); } roles.add(role); } } and public abstract class Role implements IDataObject { /** * @ojb.field primarykey=true */ private String id; /** * @ojb.reference foreignkey=documentBaseId auto-update=none auto-delete=none */ private DocumentBase documentBase; public Role(DocumentBase base) { super(); this.documentBase = base; } public Role() { super(); } public String getId() { return id; } public void setId(String id) { this.id = id; } public DocumentBase getDocumentBase() { return documentBase; } public boolean equals(Object object) { if (object instanceof Role) { return this.id.equals(((IDataObject) object).getId()); } return false; } public String toString() { return this.getClass() + + this.getDocumentBase(); } } and what i am trying to do is Role admin = new Admin(getCurrentBase()); DataHelper.generateId(admin); User t = getTestUser(); t.addRole(admin); DataHelper.store(t); If u have any clue about... Thank you. Jean-Yves sql statement was 'INSERT INTO Admin (userId,documentBaseId,id) VALUES (?,?,?) '. Exception message is [ERREUR: Une valeur NULL dans la colonne «userid» viole la contrainte NOT NULL] Vendor error code [0] SQL state code [23502=NOT NULL VIOLATION] Target class is 'org.jys.clepsydra.data.users.Admin'. PK of the target object is [id=3eg3Lcb;b,YDSW2Eet\B7XX]. Source object: class org.jys.clepsydra.data.users.Admin [EMAIL PROTECTED]trHx` :=36,iVikR@testDocumentBase at org.apache.ojb.broker.util.ExceptionHelper.generateException(ExceptionHelper.java:161) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:241) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:2256) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:988) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:172) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:172) at org.apache.ojb.odmg.ObjectEnvelope.doInsert(ObjectEnvelope.java:767) at org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:106) at org.apache.ojb.odmg.ObjectEnvelopeTable.writeAllEnvelopes(ObjectEnvelopeTable.java:249) at org.apache.ojb.odmg.ObjectEnvelopeTable.writeObjects(ObjectEnvelopeTable.java:185) at org.apache.ojb.odmg.TransactionImpl.doWriteObjects(TransactionImpl.java:384) at org.apache.ojb.odmg.TransactionImpl.prepareCommit(TransactionImpl.java:743) at org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:679) at org.jys.clepsydra.pers.OJBPersistencer.store(OJBPersistencer.java:69) at $IPersistencer_1072de1a612.store($IPersistencer_1072de1a612.java) at org.jys.clepsydra.DataHelper.store(DataHelper.java:118) at org.jys.clepsydra.testing.tests.TestBaseCreation.testAddRoleToFirstUser(TestBaseCreation.java:197) at org.jys.clepsydra.testing.TestInitService.run(TestInitService.java:31) at $Runnable_1072de1a617.run($Runnable_1072de1a617.java) at $Runnable_1072de1a616.run($Runnable_1072de1a616.java) at org.jys.clepsydra.services.InitService.run(InitService.java:53) at $Runnable_1072de1a611.run($Runnable_1072de1a611.java) at $Runnable_1072de1a610.run($Runnable_1072de1a610.java) at org.jys.clepsydra.DataHelper.init(DataHelper.java:71) at
Re: Foreign key not set
Hi Jean-Yves, in User the 1:n reference the auto-update setting is undefined and by default OJB use 'link' for 1:n relations, thus I would expect that the FK in Admin will be set. Could you post the generated repository.xml for User, Admin, Role? regards Armin Jean-Yves Sironneau wrote: Hello, I'am having trouble trying to find out what i am doing wrong, i have a class user and a class role and a user has a collection of roles, this kind of schema is working for other classes with the same kind of relationship but not for this one. OJB is trying to insert a null value in the column of the foreign key id, but the role is in the collection of roles of the user instance. I'am using latest CVS OJB, my two classes are : public class User implements INamable { /** * @ojb.field primarykey=true */ private String id; */** * @ojb.collection element-class-ref=org.jys.clepsydra.data.users.Role * foreignkey=userId auto-delete=true */ private ListRole roles = new VectorRole(); * /** * @ojb.field */ private String url; public User(String name) { this.name = name; } public User() { super(); } /** * @return Returns the roles. */ public ListRole getRoles() { return roles; } /** * @param role * @throws DataIntegrityException */ public void addRole(final Role role) throws DataIntegrityException { if (findRole(role.getDocumentBase()) != null) { throw new DataIntegrityException(this + already has a role for + role.getDocumentBase()); } roles.add(role); } } and public abstract class Role implements IDataObject { /** * @ojb.field primarykey=true */ private String id; /** * @ojb.reference foreignkey=documentBaseId auto-update=none auto-delete=none */ private DocumentBase documentBase; public Role(DocumentBase base) { super(); this.documentBase = base; } public Role() { super(); } public String getId() { return id; } public void setId(String id) { this.id = id; } public DocumentBase getDocumentBase() { return documentBase; } public boolean equals(Object object) { if (object instanceof Role) { return this.id.equals(((IDataObject) object).getId()); } return false; } public String toString() { return this.getClass() + + this.getDocumentBase(); } } and what i am trying to do is Role admin = new Admin(getCurrentBase()); DataHelper.generateId(admin); User t = getTestUser(); t.addRole(admin); DataHelper.store(t); If u have any clue about... Thank you. Jean-Yves sql statement was 'INSERT INTO Admin (userId,documentBaseId,id) VALUES (?,?,?) '. Exception message is [ERREUR: Une valeur NULL dans la colonne «userid» viole la contrainte NOT NULL] Vendor error code [0] SQL state code [23502=NOT NULL VIOLATION] Target class is 'org.jys.clepsydra.data.users.Admin'. PK of the target object is [id=3eg3Lcb;b,YDSW2Eet\B7XX]. Source object: class org.jys.clepsydra.data.users.Admin [EMAIL PROTECTED]trHx` :=36,iVikR@testDocumentBase at org.apache.ojb.broker.util.ExceptionHelper.generateException(ExceptionHelper.java:161) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:241) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:2256) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:988) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:172) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:172) at org.apache.ojb.odmg.ObjectEnvelope.doInsert(ObjectEnvelope.java:767) at org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:106) at org.apache.ojb.odmg.ObjectEnvelopeTable.writeAllEnvelopes(ObjectEnvelopeTable.java:249) at org.apache.ojb.odmg.ObjectEnvelopeTable.writeObjects(ObjectEnvelopeTable.java:185) at org.apache.ojb.odmg.TransactionImpl.doWriteObjects(TransactionImpl.java:384) at org.apache.ojb.odmg.TransactionImpl.prepareCommit(TransactionImpl.java:743) at org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:679) at org.jys.clepsydra.pers.OJBPersistencer.store(OJBPersistencer.java:69) at $IPersistencer_1072de1a612.store($IPersistencer_1072de1a612.java) at org.jys.clepsydra.DataHelper.store(DataHelper.java:118) at org.jys.clepsydra.testing.tests.TestBaseCreation.testAddRoleToFirstUser(TestBaseCreation.java:197) at org.jys.clepsydra.testing.TestInitService.run(TestInitService.java:31) at $Runnable_1072de1a617.run($Runnable_1072de1a617.java) at $Runnable_1072de1a616.run($Runnable_1072de1a616.java) at
Re: proxy question
Not really sure, I just wiped out the classes directory and rebuilt completely. Then I opened the class file generated and found the appropriate method in the class file, so I know it's there (and it's the only class named AccountProxy). Just to satisfy my curiosity I set it up through a debugger and by the time it gets to the exception I can see all of the constuctor methods (as referent under declaredConstructors). One of the odd things though is that declaredConstructors is marked in red in Eclipse which tells me something is wrong, but I have no idea what it is. -warner On 10/26/05, Thomas Dudziak [EMAIL PROTECTED] wrote: On 10/26/05, Warner Onstine [EMAIL PROTECTED] wrote: Well, I was hoping that that would do the trick but no dice. I'm still getting the error that it cannot create a proxy using my proxy class. snip Caused by: java.lang.NoSuchMethodException: org.kuali.module.chart.bo.AccountProxy.init(java.lang.reflect.InvocationHandler) at java.lang.Class.getConstructor0(Class.java:1937) at java.lang.Class.getDeclaredConstructor(Class.java:1301) at org.apache.ojb.broker.core.proxy.VirtualProxy.createProxy(VirtualProxy.java:116) I have now implemented the following constructors (and the Serializable interface per the unit test): public AccountProxy(){ super(); } public AccountProxy(PBKey key, Identity uniqueId) { super(key, uniqueId); } public AccountProxy(IndirectionHandler handler) { super(handler); } Any other ideas? Could it be that you have some classpath problem there ? The exception (and the corresponding source code of VirtualProxy) state that a constructor with a single argument of IndirectionHandler is searched for in your class, but could not be found. Tom - 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 not set
here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) { super(base); } public Viewer() { super(); } } public class Author extends Viewer { public Author(DocumentBase base) { super(base); } public Author() { super(); } } public class Admin extends Author { public Admin(DocumentBase base) { super(base); } public Admin() { super(); } } class-descriptor class=org.jys.clepsydra.data.users.Admin table=Admin field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Author table=Author extent-class class-ref=org.jys.clepsydra.data.users.Admin/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Role table=Role extent-class class-ref=org.jys.clepsydra.data.users.Viewer/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.User table=UUser field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor field-descriptor name=creationDate column=creationDate jdbc-type=DATE /field-descriptor field-descriptor name=active column=active jdbc-type=BIT /field-descriptor field-descriptor name=name column=name jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=password column=password jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=applicationAdmin column=applicationAdmin jdbc-type=BIT /field-descriptor field-descriptor name=email column=email jdbc-type=VARCHAR length=254 /field-descriptor field-descriptor name=url column=url jdbc-type=VARCHAR length=254 /field-descriptor collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Viewer table=Viewer extent-class class-ref=org.jys.clepsydra.data.users.Author/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId
Re: Foreign key not set
Could you try to set auto-update=link in 1:n reference of User and run your test again: collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-update=link auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor regards Armin Jean-Yves Sironneau wrote: here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) { super(base); } public Viewer() { super(); } } public class Author extends Viewer { public Author(DocumentBase base) { super(base); } public Author() { super(); } } public class Admin extends Author { public Admin(DocumentBase base) { super(base); } public Admin() { super(); } } class-descriptor class=org.jys.clepsydra.data.users.Admin table=Admin field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Author table=Author extent-class class-ref=org.jys.clepsydra.data.users.Admin/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Role table=Role extent-class class-ref=org.jys.clepsydra.data.users.Viewer/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.User table=UUser field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor field-descriptor name=creationDate column=creationDate jdbc-type=DATE /field-descriptor field-descriptor name=active column=active jdbc-type=BIT /field-descriptor field-descriptor name=name column=name jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=password column=password jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=applicationAdmin column=applicationAdmin jdbc-type=BIT /field-descriptor field-descriptor name=email column=email jdbc-type=VARCHAR length=254 /field-descriptor field-descriptor name=url column=url jdbc-type=VARCHAR length=254 /field-descriptor collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor /class-descriptor class-descriptor
Re: Foreign key not set
i'am getting the same error. i'am going to try to do it with a non abstract class maybe it can be that. Armin Waibel wrote: Could you try to set auto-update=link in 1:n reference of User and run your test again: collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-update=link auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor regards Armin Jean-Yves Sironneau wrote: here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) { super(base); } public Viewer() { super(); } } public class Author extends Viewer { public Author(DocumentBase base) { super(base); } public Author() { super(); } } public class Admin extends Author { public Admin(DocumentBase base) { super(base); } public Admin() { super(); } } class-descriptor class=org.jys.clepsydra.data.users.Admin table=Admin field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Author table=Author extent-class class-ref=org.jys.clepsydra.data.users.Admin/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Role table=Role extent-class class-ref=org.jys.clepsydra.data.users.Viewer/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.User table=UUser field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor field-descriptor name=creationDate column=creationDate jdbc-type=DATE /field-descriptor field-descriptor name=active column=active jdbc-type=BIT /field-descriptor field-descriptor name=name column=name jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=password column=password jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=applicationAdmin column=applicationAdmin jdbc-type=BIT /field-descriptor field-descriptor name=email column=email jdbc-type=VARCHAR length=254 /field-descriptor field-descriptor name=url column=url jdbc-type=VARCHAR length=254 /field-descriptor collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-delete=true
Re: proxy question
Alright so it does appear to have been caused by some weird classpath issue. But now I'm running into another problem. org.apache.ojb.broker.PersistenceBrokerException: org.apache.ojb.broker.PersistenceBrokerException: Error invoking method toString at org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl.materializeSubject(IndirectionHandlerDefaultImpl.java:384) at org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl.getRealSubject(IndirectionHandlerDefaultImpl.java:348) at org.apache.ojb.broker.core.proxy.VirtualProxy.getRealSubject(VirtualProxy.java:135) at org.kuali.module.chart.bo.AccountProxy.realSubject(AccountProxy.java:75) at org.kuali.module.chart.bo.AccountProxy.getAccountNumber(AccountProxy.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773) at org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1132) at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686) at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715) at org.kuali.core.web.struts.pojo.PojoPropertyUtilsBean.getProperty(PojoPropertyUtilsBean.java:53) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290) at org.kuali.core.util.BeanPropertyComparator.compare(BeanPropertyComparator.java:142) at java.util.Arrays.mergeSort(Arrays.java:1278) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.mergeSort(Arrays.java:1289) at java.util.Arrays.sort(Arrays.java:1219) at java.util.Collections.sort(Collections.java:155) at org.kuali.core.lookup.KualiLookupableImpl.getSearchResults(KualiLookupableImpl.java:321) at org.kuali.core.web.struts.action.KualiLookupAction.search(KualiLookupAction.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276) at org.kuali.core.web.struts.action.KualiAction.execute(KualiAction.java:69) at org.kuali.core.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:233) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.kuali.core.web.filter.KualiCasFilter.doFilter(KualiCasFilter.java:106) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at
M:N storage removes duplicate elements
I have an indirection table foo_bar that happily implements an m:n relationship between foo and bar. the columns of foo_bar include foo_id, bar_id, and a unique id for the association itself (mysql backend, the id column is inserted automatically). This is because it is relevant to my application to materialize references to the same object at different indices of the collection upon retrieval. I started out doing all the insertion into this table by hand. When I retrieve foo or bar, I successfully get a collection containing all the expected elements at all the right indices. But now I'm trying to get more sophisticated, and thus writing an online editor for this relationship instead of populating the foo_bar table through the mysql command line. What I'm finding is that OJB is deduping my collection by ignoring successive references to elements it has already seen in the current transaction. The result is that I don't get as many rows inserted into my indirection table as I want. For instance: Foo foo1 = new Foo(); Bar bar1 = new Bar(); broker.beginTransaction(); broker.store( bar1 ); broker.store( foo1 ); bar1.getFoos().add( foo1 ); bar1.getFoos().add( foo1 ); broker.store( bar1 ); broker.commitTransaction(); I would expect the above to result in an insert into the foo table, an insert into the bar table, and 2 insertions into the foo_bar table. I get the expected behavior in the foo and bar tables, but I only get one new record into the foo_bar table. Someone I know suggested that I manually iterate over the collection using the link() and unlink() methods of BrokerHelper, but I was convinced that there was a more elegant way to do this, possibly a configuration file tweak to tell OJB to create multiple links in the indirection table rather than assuming that I only want one. Your thoughts appreciated. - Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: proxy question
On 10/27/05, Warner Onstine [EMAIL PROTECTED] wrote: Alright so it does appear to have been caused by some weird classpath issue. But now I'm running into another problem. org.apache.ojb.broker.PersistenceBrokerException: org.apache.ojb.broker.PersistenceBrokerException: Error invoking method toString at org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl.materializeSubject(IndirectionHandlerDefaultImpl.java:384) at org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl.getRealSubject(IndirectionHandlerDefaultImpl.java:348) at org.apache.ojb.broker.core.proxy.VirtualProxy.getRealSubject(VirtualProxy.java:135) You could debug these methods to see whether the call Object realSubject = broker.getObjectByIdentity(id); that is in materializeSubject actually retrieves an object or not (thus you'd end up with a null value). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: M:N storage removes duplicate elements
On 10/27/05, Jason A. Lunn [EMAIL PROTECTED] wrote: I have an indirection table foo_bar that happily implements an m:n relationship between foo and bar. the columns of foo_bar include foo_id, bar_id, and a unique id for the association itself (mysql backend, the id column is inserted automatically). This is because it is relevant to my application to materialize references to the same object at different indices of the collection upon retrieval. I started out doing all the insertion into this table by hand. When I retrieve foo or bar, I successfully get a collection containing all the expected elements at all the right indices. But now I'm trying to get more sophisticated, and thus writing an online editor for this relationship instead of populating the foo_bar table through the mysql command line. What I'm finding is that OJB is deduping my collection by ignoring successive references to elements it has already seen in the current transaction. The result is that I don't get as many rows inserted into my indirection table as I want. For instance: Foo foo1 = new Foo(); Bar bar1 = new Bar(); broker.beginTransaction(); broker.store( bar1 ); broker.store( foo1 ); bar1.getFoos().add( foo1 ); bar1.getFoos().add( foo1 ); broker.store( bar1 ); broker.commitTransaction(); I would expect the above to result in an insert into the foo table, an insert into the bar table, and 2 insertions into the foo_bar table. I get the expected behavior in the foo and bar tables, but I only get one new record into the foo_bar table. Someone I know suggested that I manually iterate over the collection using the link() and unlink() methods of BrokerHelper, but I was convinced that there was a more elegant way to do this, possibly a configuration file tweak to tell OJB to create multiple links in the indirection table rather than assuming that I only want one. Your thoughts appreciated. How is the indirection table defined in the database ? Is there a compound primary key defined over the columns used to refer to the two classes ? Also, you could configure P6Spy to trace the generated SQL in order to see whether OJB or the database ignores the second insert. Details on how to configure P6Spy can be found here: http://db.apache.org/ojb/docu/faq.html#traceProfileSQL Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Foreign key not set
Jean-Yves Sironneau wrote: i'am getting the same error. i'am going to try to do it with a non abstract class maybe it can be that. I setup a similar test Implementation odmg = OJB.getInstance(); Database db = odmg.newDatabase(); db.open(null, Database.OPEN_READ_WRITE); BookShelf bookShelf = new BookShelf(prefix); TransactionExt tx = (TransactionExt) odmg.newTransaction(); tx.begin(); db.makePersistent(bookShelf); tx.commit(); tx.begin(); tx.lock(bookShelf, Transaction.WRITE); BookShelfItem ev1 = new DVD(bookShelf); BookShelfItem ev2 = new Book(bookShelf); bookShelf.addItem(ev1); bookShelf.addItem(ev2); tx.commit(); works fine! BookSelf has a 1:n to abstract class BookSelfItem and the test add a concrete objects to an existing BookSelf object. The FK is defined as anonymous field in the abstract class: class-descriptor class=org.apache.ojb.broker.CollectionTest$BookShelfItem extent-class class-ref=org.apache.ojb.broker.CollectionTest$Book/ extent-class class-ref=org.apache.ojb.broker.CollectionTest$DVD/ /class-descriptor class-descriptor class=org.apache.ojb.broker.CollectionTest$BookShelf table=COL_BOOKSHELFS ... collection-descriptor name=items element-class-ref=org.apache.ojb.broker.CollectionTest$BookShelfItem auto-retrieve=true inverse-foreignkey field-ref=shelfFk/ /collection-descriptor /class-descriptor class-descriptor class=org.apache.ojb.broker.CollectionTest$Book table=COL_BOOKS field-descriptor name=pk column=PK jdbc-type=INTEGER primarykey=true autoincrement=true / field-descriptor name=shelfFk column=BOOKSHELF_FK jdbc-type=INTEGER access=anonymous / reference-descriptor name=shelf class-ref=org.apache.ojb.broker.CollectionTest$BookShelf auto-retrieve=true auto-update=false auto-delete=false proxy=true foreignkey field-ref=shelfFk/ /reference-descriptor /class-descriptor Did you checked your test with a debugger? Is the PK of the User object populated with non null value? I don't know what's going on in your persistence layer, is User 't' locked before the admin is added? But something like that will work too: ... BookShelfItem ev1 = new DVD(bookShelf); BookShelfItem ev2 = new Book(bookShelf); bookShelf.addItem(ev1); bookShelf.addItem(ev2); tx.begin(); tx.lock(bookShelf, Transaction.READ); db.makePersistent(ev1); db.makePersistent(ev2); tx.commit(); Could you setup a test only using the odmg-api which reproduce your problem? regards, Armin Armin Waibel wrote: Could you try to set auto-update=link in 1:n reference of User and run your test again: collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-update=link auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor regards Armin Jean-Yves Sironneau wrote: here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) { super(base); } public Viewer() { super(); } } public class Author extends Viewer { public Author(DocumentBase base) { super(base); } public Author() { super(); } } public class Admin extends Author { public Admin(DocumentBase base) { super(base); } public Admin() { super(); } } class-descriptor class=org.jys.clepsydra.data.users.Admin table=Admin field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Author table=Author extent-class class-ref=org.jys.clepsydra.data.users.Admin/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor
Re: Foreign key not set
So i still don't get it, the workaround is to not use anonymous foreign key and to set the userId myself... As i don' t know in OJB where the anonymous key is supposed to be set i can't really try to find the bug for now, but i'll try to take a look. Thanks for your help. Jean-Yves Sironneau wrote: i'am getting the same error. i'am going to try to do it with a non abstract class maybe it can be that. Armin Waibel wrote: Could you try to set auto-update=link in 1:n reference of User and run your test again: collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-update=link auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor regards Armin Jean-Yves Sironneau wrote: here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) { super(base); } public Viewer() { super(); } } public class Author extends Viewer { public Author(DocumentBase base) { super(base); } public Author() { super(); } } public class Admin extends Author { public Admin(DocumentBase base) { super(base); } public Admin() { super(); } } class-descriptor class=org.jys.clepsydra.data.users.Admin table=Admin field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Author table=Author extent-class class-ref=org.jys.clepsydra.data.users.Admin/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Role table=Role extent-class class-ref=org.jys.clepsydra.data.users.Viewer/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.User table=UUser field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor field-descriptor name=creationDate column=creationDate jdbc-type=DATE /field-descriptor field-descriptor name=active column=active jdbc-type=BIT /field-descriptor field-descriptor name=name column=name jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=password column=password jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=applicationAdmin column=applicationAdmin jdbc-type=BIT /field-descriptor field-descriptor name=email column=email
Re: Foreign key not set
Hi again, a correction of my previous post (I don't realized that you use the odmg-api). In the new upcoming version you have to set auto-update=none and auto-delete=none or object when using the odmg-api. collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-update=none auto-delete=none or object inverse-foreignkey field-ref=userId/ /collection-descriptor regards, Armin Jean-Yves Sironneau wrote: i'am getting the same error. i'am going to try to do it with a non abstract class maybe it can be that. Armin Waibel wrote: Could you try to set auto-update=link in 1:n reference of User and run your test again: collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-update=link auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor regards Armin Jean-Yves Sironneau wrote: here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) { super(base); } public Viewer() { super(); } } public class Author extends Viewer { public Author(DocumentBase base) { super(base); } public Author() { super(); } } public class Admin extends Author { public Admin(DocumentBase base) { super(base); } public Admin() { super(); } } class-descriptor class=org.jys.clepsydra.data.users.Admin table=Admin field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Author table=Author extent-class class-ref=org.jys.clepsydra.data.users.Admin/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.Role table=Role extent-class class-ref=org.jys.clepsydra.data.users.Viewer/ field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=documentBaseId column=documentBaseId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor reference-descriptor name=documentBase class-ref=org.jys.clepsydra.data.DocumentBase auto-update=none auto-delete=none foreignkey field-ref=documentBaseId/ /reference-descriptor /class-descriptor class-descriptor class=org.jys.clepsydra.data.users.User table=UUser field-descriptor name=id column=id jdbc-type=VARCHAR primarykey=true length=254 /field-descriptor field-descriptor name=creationDate column=creationDate jdbc-type=DATE /field-descriptor field-descriptor name=active column=active jdbc-type=BIT /field-descriptor field-descriptor name=name column=name jdbc-type=VARCHAR nullable=false length=254 /field-descriptor field-descriptor name=password column=password jdbc-type=VARCHAR nullable=false length=254 /field-descriptor
Re: Foreign key not set
I can not keep trying right now, but i will tomorrow, the visible difference i see is that of storing the user i use the way : Transaction tx = getImplementation().newTransaction(); tx.begin(); db.makePersistent(o); tx.commit(); But the collections of roles is modified before that. Maybe i'am not doing it the right way, but it's working for all my other similar relations... Are we supposed to lock the object before any modification are made to it ? When i tried the way you did in the sample you give i get an exception org.apache.ojb.odmg.TransactionAbortedExceptionOJB: Can't commit objects: Unexpected behavior java.lang.RuntimeException: Unexpected behavior org.apache.ojb.odmg.ObjectEnvelopeTable.cascadeInsertSingleReferences(ObjectEnvelopeTable.java:602) org.apache.ojb.odmg.ObjectEnvelopeTable.cascadeInsertFor(ObjectEnvelopeTable.java:555) org.apache.ojb.odmg.ObjectEnvelopeTable.cascadeMarkedForInsert(ObjectEnvelopeTable.java:535) org.apache.ojb.odmg.ObjectEnvelopeTable.cascadingDependents(ObjectEnvelopeTable.java:504) Armin Waibel wrote: Jean-Yves Sironneau wrote: i'am getting the same error. i'am going to try to do it with a non abstract class maybe it can be that. I setup a similar test Implementation odmg = OJB.getInstance(); Database db = odmg.newDatabase(); db.open(null, Database.OPEN_READ_WRITE); BookShelf bookShelf = new BookShelf(prefix); TransactionExt tx = (TransactionExt) odmg.newTransaction(); tx.begin(); db.makePersistent(bookShelf); tx.commit(); tx.begin(); tx.lock(bookShelf, Transaction.WRITE); BookShelfItem ev1 = new DVD(bookShelf); BookShelfItem ev2 = new Book(bookShelf); bookShelf.addItem(ev1); bookShelf.addItem(ev2); tx.commit(); works fine! BookSelf has a 1:n to abstract class BookSelfItem and the test add a concrete objects to an existing BookSelf object. The FK is defined as anonymous field in the abstract class: class-descriptor class=org.apache.ojb.broker.CollectionTest$BookShelfItem extent-class class-ref=org.apache.ojb.broker.CollectionTest$Book/ extent-class class-ref=org.apache.ojb.broker.CollectionTest$DVD/ /class-descriptor class-descriptor class=org.apache.ojb.broker.CollectionTest$BookShelf table=COL_BOOKSHELFS ... collection-descriptor name=items element-class-ref=org.apache.ojb.broker.CollectionTest$BookShelfItem auto-retrieve=true inverse-foreignkey field-ref=shelfFk/ /collection-descriptor /class-descriptor class-descriptor class=org.apache.ojb.broker.CollectionTest$Book table=COL_BOOKS field-descriptor name=pk column=PK jdbc-type=INTEGER primarykey=true autoincrement=true / field-descriptor name=shelfFk column=BOOKSHELF_FK jdbc-type=INTEGER access=anonymous / reference-descriptor name=shelf class-ref=org.apache.ojb.broker.CollectionTest$BookShelf auto-retrieve=true auto-update=false auto-delete=false proxy=true foreignkey field-ref=shelfFk/ /reference-descriptor /class-descriptor Did you checked your test with a debugger? Is the PK of the User object populated with non null value? I don't know what's going on in your persistence layer, is User 't' locked before the admin is added? But something like that will work too: ... BookShelfItem ev1 = new DVD(bookShelf); BookShelfItem ev2 = new Book(bookShelf); bookShelf.addItem(ev1); bookShelf.addItem(ev2); tx.begin(); tx.lock(bookShelf, Transaction.READ); db.makePersistent(ev1); db.makePersistent(ev2); tx.commit(); Could you setup a test only using the odmg-api which reproduce your problem? regards, Armin Armin Waibel wrote: Could you try to set auto-update=link in 1:n reference of User and run your test again: collection-descriptor name=roles element-class-ref=org.jys.clepsydra.data.users.Role auto-update=link auto-delete=true inverse-foreignkey field-ref=userId/ /collection-descriptor regards Armin Jean-Yves Sironneau wrote: here is the extract of the repository file : Oups i think i forgot to explain that Role is an abstract class, and that Viewer inherits from Role, Author from Viewer and Admin from Author here are the classes too : public class Viewer extends Role { public Viewer(DocumentBase base) { super(base); } public Viewer() { super(); } } public class Author extends Viewer { public Author(DocumentBase base) { super(base); } public Author() { super(); } } public class Admin extends Author { public Admin(DocumentBase base) { super(base); } public Admin() { super(); } } class-descriptor class=org.jys.clepsydra.data.users.Admin table=Admin field-descriptor name=userId column=userId jdbc-type=VARCHAR nullable=false length=254 access=anonymous /field-descriptor
Re: M:N storage removes duplicate elements
On Oct 26, 2005, at 19:00, Thomas Dudziak wrote: On 10/27/05, Jason A. Lunn [EMAIL PROTECTED] wrote: I have an indirection table foo_bar that happily implements an m:n relationship between foo and bar. the columns of foo_bar include foo_id, bar_id, and a unique id for the association itself (mysql backend, the id column is inserted automatically). This is because it is relevant to my application to materialize references to the same object at different indices of the collection upon retrieval. I started out doing all the insertion into this table by hand. When I retrieve foo or bar, I successfully get a collection containing all the expected elements at all the right indices. But now I'm trying to get more sophisticated, and thus writing an online editor for this relationship instead of populating the foo_bar table through the mysql command line. What I'm finding is that OJB is deduping my collection by ignoring successive references to elements it has already seen in the current transaction. The result is that I don't get as many rows inserted into my indirection table as I want. For instance: Foo foo1 = new Foo(); Bar bar1 = new Bar(); broker.beginTransaction(); broker.store( bar1 ); broker.store( foo1 ); bar1.getFoos().add( foo1 ); bar1.getFoos().add( foo1 ); broker.store( bar1 ); broker.commitTransaction(); I would expect the above to result in an insert into the foo table, an insert into the bar table, and 2 insertions into the foo_bar table. I get the expected behavior in the foo and bar tables, but I only get one new record into the foo_bar table. Someone I know suggested that I manually iterate over the collection using the link() and unlink() methods of BrokerHelper, but I was convinced that there was a more elegant way to do this, possibly a configuration file tweak to tell OJB to create multiple links in the indirection table rather than assuming that I only want one. Your thoughts appreciated. How is the indirection table defined in the database ? Is there a compound primary key defined over the columns used to refer to the two classes ? Also, you could configure P6Spy to trace the generated SQL in order to see whether OJB or the database ignores the second insert. Details on how to configure P6Spy can be found here: http://db.apache.org/ojb/docu/faq.html#traceProfileSQL Tom CREATE TABLE `foo_bar` ( `id` int(11) NOT NULL auto_increment, `foo_id` int(11) NOT NULL default '0', `bar_id` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Here's the output from Pspy: 1130371602114|34|0|statement||select count(*) from foo 1130371602229|3|0|statement||INSERT INTO bar (name) VALUES ('bar1') 1130371602247|4|0|statement||SELECT LAST_INSERT_ID() FROM bar LIMIT 1 1130371602288|2|0|statement||INSERT INTO foo (name) VALUES ('foo1') 1130371602290|1|0|statement||SELECT LAST_INSERT_ID() FROM foo LIMIT 1 1130371602301|2|0|statement||UPDATE bar SET name='bar1' WHERE id = '5' 1130371602323|2|0|statement||SELECT foo_id FROM foo_bar WHERE bar_id='5' 1130371602357|2|0|statement||INSERT INTO foo_bar (bar_id,foo_id) VALUES ('5','7') 1130371602378|2|0|commit|| - Jason
Re: OJB configuration problem on jboss
Hi Armin, 2005/10/26, Armin Waibel [EMAIL PROTECTED]: Neil Jianguo Zhou wrote: Hi Armin, It always occurs on same sql, and be reproduceable. It seems a code error, even I doubt the prepared sql statement. However, it works fine in Resin+Oracle. Is the statement generated by OJB or by a user query (if so please post it)? It's user query. The sql is: ==(sql text begin)== SELECT DISTINCT 'BUYER' org_role_code FROM core_party_relationship WHERE subject_party_id = ? AND relationship_type_code = 'BUYER_SUPPLIER' UNION SELECT DISTINCT 'SUPPLIER' org_role_code FROM core_party_relationship WHERE object_party_id = ? AND relationship_type_code = 'BUYER_SUPPLIER' ==(sql text end)== Does batch-mode=false setting influence the issue? Does setting ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl influence the issue? All do not influence the issue, failed as former. I'd tried the following setting: 1)batch-mode=false ConnectionFactoryClass=xx.xx.ConnectionFactoryPooledImpl 2)batch-mode=false ConnectionFactoryClass=xx.xx.ConnectionFactoryDBCPImpl 3)batch-mode=true ConnectionFactoryClass=xx.xx.ConnectionFactoryPooledImpl Do you use shared libraries (e.g. commons-dbcp) or do you bundle all libraries in the webApp (.war file)? Yes, I do package all required jakarta commons libraries, including commons-dbcp.jar. and bundle all libraries in one .war file put into WEB-INF/lib directory. Is some neccessary configurations missing? I don't notice a configuration error in your settings. The java.lang.UnsupportedOperationException in managed configuration (I assume) is a result of using OJB's transaction demarcation (e.g. PB.beginTransaction call) instead of using JTA-transaction demarcation. So great. I agree with your viewpoint. I'd also looked other archived doc up in mail lists. Thank you much. Regards, Neil regards, Armin Before occurs the ORA-01008 error, there're some doubtful info in JBosss+Oracle. But there're not this kind of info in Resin+Oracle. FYI: - INFO [ObjectCacheDefaultImpl] Setup cache: [EMAIL PROTECTED],useSoftReferences=true,cachingKeyType=0,useAutoSync=true] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 7 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 7 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - INFO [ObjectCacheDefaultImpl] tx was aborted, remove 176 traced (potentially modified) objects from cache - INFO [ConnectionManagerImpl] Rollback was called, do rollback on current connection [EMAIL PROTECTED] - ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query: SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound thanks, Neil -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 4:29 PM To: OJB Users List Subject: Re: OJB configuration problem on jboss Hi Neil, this is a really strange error, seems that Oracle detect an objectionable number of bound variables in a prepared statement. You said that this error message doesn't arise in Resin+Oracle, thus it can't be a problem of OJB's sql generator. Does always the same error occur (same sql statement) or does it occur for different sql statements? Is the error reproduceable or does it occur random? If the error occur for different statements and arise radom, then the issue can be a concurrency problem - e.g. different threads using the same PB instance at the same time. regards, Armin Neil Jianguo Zhou wrote: Hi there, I use pure Servlet/JSP based code, not including any EJB based code, under JBoss app server. Use non-managed environment configuration same as other pure servlet container, such as Resin, but accessing database became unstable. It will sometimes throw exception: - ERROR [JdbcAccessImpl] SQLException during the execution of the SQL query: SELECT xxx FROM xxx WHERE xxx, message is: ORA-01008: not all variables bound However, everything is ok under other servlet container, like Resin. The non-managed environment configuration is following: 1. In OJB.properties: - PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl - ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryDBCPImpl - JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory 2. In repository_database.xml: jdbc-connection-descriptor jcd-alias=default default-connection=true platform=Oracle9i jdbc-level=2.0
RE: Using OJB with Oracle Packages and Procedures - simple Question
Fernando -- OJB can be configured to use Oracle packages/procedures for all CRUD operations. See http://db.apache.org/ojb/docu/howtos/howto-work-with-stored-procedures.html for details on how. As far as using packages/procedures for queries, I don't think support for that is present, or even planned for. Ron Gallagher -Original Message- From: Fernando Bernardino [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 9:01 AM To: ListaOJB Subject: Using OJB with Oracle Packages and Procedures - simple Question Hello people! I'm creating a app for a mobile phone/PDA's/Palms. This app connect to a servlet server and uses request/response to send/get the information. The client is an AWT frame. In the server, I'm using Struts to control my servlets and I'm thinking about to use OJB to control my DAO's. But I have to work with PKG's/PRC's from Oracle. Can I do that with OJB? Is that recomended from you guys? Thanks for your's attention. (Sorry my english..) -- Fernando Bernardino - 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]