Broker Helper -> representsNull
Hi all, I've just upgraded to RC7, and I'm now getting the following error on a call to PersistenceBroker.retrieveAllReferences(): java.lang.NullPointerException at org.apache.ojb.broker.util.BrokerHelper.representsNull(BrokerHelper.java:260) at org.apache.ojb.broker.core.QueryReferenceBroker.hasNullifiedFK(QueryReferenceBroker.java:446) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObjectIdentity(QueryReferenceBroker.java:410) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(QueryReferenceBroker.java:334) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(QueryReferenceBroker.java:396) at org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveAllReferences(PersistenceBrokerImpl.java:1145) at ... It seems that the problem is in the BrokerHelper.representsNull method. The field it is complaining about is "reportNumber", which is an anonymous field in the target class. Here's my class descriptor: ... other fields omitted for brevity ... The problem is that AnonymousPersistentField.getType() always returns null, so a NullPointerException is thrown when the BrokerHelper tries to determine if this field represents a primitive type. I would suggest the following patch: public boolean representsNull(FieldDescriptor fld, Object aValue) { if(aValue == null) return true; boolean result = false; if(((aValue instanceof Number) && (((Number) aValue).longValue() == 0))) { // PATCH STARTS HERE PersistentField field = fld.getPersistentField(); Class type = field.getType(); // AnonymousPersistentFields will *always* have a null type according to the // javadoc comments in AnonymousPersistentField.getType() if (type == null) { return true; } result = type.isPrimitive(); // PATCH ENDS HERE } else if((aValue instanceof String) && (((String) aValue).length() == 0)) { result = fld.isPrimaryKey(); } return result; } Maybe I've overlooked something, but if this method is ever called with an anonymous field with a value of 0, it will surely throw a NPE. Thoughts? Thanks, Phil Denis
Pb on jdo.getCol and Delete
All, I retrieve a jdo collection with the jdo.getCol method. I'm using dynamic proxy. I'm using an iterator on this col and delete eatch object retrieve. Later (not all time but 50% time) I commit and I have an Unmaterialized proxy error !! It seems that after a certain time (??) the proxy is unmaterialized and the commit could not order to delete the object .. Database db = impl.getDatabase(product); Collection col = jdo.getCol(); Iterator iter = col.iterator(); While (iter.hasNext()) { Jdoxx myxx = iter.next(); db.deletePersistent(myxx); } blablablablablablabla.later on commit(); What wrong in my logic ??? Any help would be appreciated ! Tx !!
Re: Cascading anonymous keys
I have encountered an error that I think may be related to my other anonymous key issues. Some of my objects have references with FK values of 0. I had been using primitives for many of these, but I have gone back and updated all my key fields to be classes. I think this may have contributed to my earlier issues. However, when I try to access an object with a FK value of 0 that is using an anonymous key I get a null pointer exception. If I don't use anonymous keys, I don't have this problem. Do anonymous keys use primitives? Any ideas or workarounds? Here is the stacktrace, though it isn't very interesting. java.lang.NullPointerException at org.apache.ojb.broker.util.BrokerHelper.representsNull(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.hasNullifiedFK(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getReferencedObjectIdentity(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReference(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.retrieveReferences(Unknown Source) at org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(Unknown Source) at org.apache.ojb.broker.accesslayer.RsIterator.next(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(Unknown Source) at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.loadData(Unknown Source) at org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl.loadData(Unknown Source) at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.getData(Unknown Source) at org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl.iterator(Unknown Source) at org.apache.taglibs.standard.tag.common.core.ForEachSupport.toForEachIterator(Unknown Source) at org.apache.taglibs.standard.tag.common.core.ForEachSupport.supportedTypeForEachIterator(Unknown Source) at org.apache.taglibs.standard.tag.common.core.ForEachSupport.prepare(Unknown Source) at javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(Unknown Source) at org.apache.jsp.pages.StaffDirectory_jspx._jspx_meth_c_forEach_1(StaffDirectory_jspx.java:297) at org.apache.jsp.pages.StaffDirectory_jspx._jspx_meth_c_forEach_0(StaffDirectory_jspx.java:263) at org.apache.jsp.pages.StaffDirectory_jspx._jspService(StaffDirectory_jspx.java:148) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012) at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:582) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:697) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
Re: Question on update processing
Hi Raghavan, Kollivakkam R. Raghavan wrote: When we store data into a database using OJB, in order to solve the concurrent change issue we're created a col called mod_num (integer) which we are setting up to auto increment on each update to that row. The idea is to not allow a change to happen if the mod_num in the db does not match the value in the data object (i.e. someone else has updated the record). 2 questions: 1. Is this the best way to do this? 2. If this is acceptable (I've seen other commercial software use this mechanism), then what's the best way to setup OJB to help me without everyone having to worry about this logic this sounds like optimistic locking. Please have a look at http://db.apache.org/ojb/docu/faq.html#optimisticLocking regards, Armin Thanks Raghavan - 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]
Question on update processing
When we store data into a database using OJB, in order to solve the concurrent change issue we're created a col called mod_num (integer) which we are setting up to auto increment on each update to that row. The idea is to not allow a change to happen if the mod_num in the db does not match the value in the data object (i.e. someone else has updated the record). 2 questions: 1. Is this the best way to do this? 2. If this is acceptable (I've seen other commercial software use this mechanism), then what's the best way to setup OJB to help me without everyone having to worry about this logic Thanks Raghavan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question - Mapping Classes on Multiple Joined Tables
Hi Colin, Colin Kilburn wrote: Hi, Is this still an issue in RC7? I'd really like to use this approach but I'm using the ODMG api. hmm, AFAIK we don't have an test case for use of multiple joined tables with the ODMG api. So the answer is give it a try. ODMG-api behave similar to PB auto-update/delete 'true' or 'object' so I think it could be work. regards, Armin Thanks in advance, Colin Armin Waibel wrote: Hi Luis, Luis Cruz wrote: Hello, Is mapping classes on multiple joined tables compatible with the use of ODMG? I ask because according to the documentation, auto-update must be set to true in order to achieve such a mapping, however, ODMG is only guaranteed to work with auto-update set to false. I add a new ODMG test case for mapping classes on multiple joined tables (org.apache.ojb.odmg.InheritanceMultipleTableTest). Currently two tests fail (of 10). So mapping classes on multiple joined tables is not compatible and need to be fixed. regards, Armin Thanks in advance, Luis Cruz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Warnings in Managed Environment with RC7
Hi Gary, Gary wrote: No, I first commit or rollback the transaction, and then close the PB. ok, so I think this is the reason for the failure. In managed environments the PB instance has the same behavior as a DataSource in managed environments. Means that you operate with an PB handle instance (wraps the real PB instance) and after use you have to close the handle instance. If you use an connection from a DataSource in an managed environment you have to close the connection before the tx was completed too (I think so). Maybe it will be better only to log an warning instead of throwing an exception in this case. regards, Armin Gary --- Armin Waibel <[EMAIL PROTECTED]> wrote: Gary wrote: Armin: Thanks for the quick reply. Do you guys have a "contribute" site like SourceForge so I could buy you a beer? Think I should avoid to drink alcohol, because your problem seems really sophisticated ;-) No, I wasn't using the "Sync" factory. When I change to it, I get a new error: 2004-06-15 15:19:29,798 ERROR [TCP Connection(7)-172.24.54.129] Connection is in local transaction, do a 'localCommit' or 'localRollback' beforeperform the connection release - rollback the connection now (org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.releaseConnection(ConnectionManagerImpl.java)) hmm, do you close the PB instance within the used method or before the tx demarcation ends? I assume you don't. regards, Armin It has the following stack trace: System Thread [TCP Connection(7)-172.24.54.129] (Suspended) ConnectionManagerImpl.releaseConnection() line: 295 PersistenceBrokerFactorySyncImpl$PersistenceBrokerSyncImpl.beforeCompletion() line: 240 PersistenceBrokerFactorySyncImpl$TransactionBox.beforeCompletion() line: 418 RegisteredSyncs.distributeBefore() line: 110 TransactionImpl.internalPrepare() line: 1211 TransactionImpl.commit() line: 960 TranManagerImpl.commit() line: 150 TranManagerSet.commit() line: 182 My OJB.properties is as follows: # # OJB.properties -- configuration of the OJB runtime environment # Version: 1.0 # (c) 2001, 2002, 2003 Apache Software Foundation # Author: Thomas Mahler and many others # @version $Id: OJB.properties,v 1.70 2004/06/03 23:46:08 arminw Exp $ # # # repository file settings # # The repositoryFile entry tells OJB to use this file as as its standard mapping # repository. The file is looked up from the classpath. # repositoryFile=repository.xml # # If the useSerializedRepository entry is set to true, OJB tries to load a # serialized version of the repository for performance reasons. # if set to false, OJB always loads the xml file. # Setting this flag to true will accelerate the startup sequence of OJB. # If set to true changes to the repository.xml file will only be detected # after maually deleting the repository.xml.serialized file. useSerializedRepository=false # # If Repository serialization is used the entry serializedRepositoryPath defines the # directory where the Repository is written to and read from. # this entry is used only when the useSerializedRepository flag is set to true # serializedRepositoryPath=. # # # PersistenceBrokerFactory / PersistenceBroker # # The PersistenceBrokerFactoryClass entry decides which concrete # PersistenceBrokerFactory implemention is to be used. #PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl # If in managed environment *only* the PB-api was used it's recommended to use this factory # to enable the PersistenceBroker instances to participate in the JTA transaction. This makes # e.g. PBStateListener work properly in managed environments. PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl # # # The PersistenceBrokerClass entry decides which concrete PersistenceBroker # implementation is to be served by the PersistenceBrokerFactory. # This is the singlevm implementation: PersistenceBrokerClass=edu.mayo.evolution.infrastructure.ojb.EvolutionPersistenceBrokerImpl #PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl # # This is an implementation that uses Prevayler (prevayler.sf.net) as the persistent storage. # Using this implementation OJB works as a simple OODBMS #PersistenceBrokerClass=org.apache.ojb.broker.prevayler.PBPrevaylerImpl # # # PersistenceBroker pool # # PersistenceBroker pool configuration # This pool uses the jakarta-commons-pool api. # There
Re: Question - Mapping Classes on Multiple Joined Tables
Hi, Is this still an issue in RC7? I'd really like to use this approach but I'm using the ODMG api. Thanks in advance, Colin Armin Waibel wrote: Hi Luis, Luis Cruz wrote: Hello, Is mapping classes on multiple joined tables compatible with the use of ODMG? I ask because according to the documentation, auto-update must be set to true in order to achieve such a mapping, however, ODMG is only guaranteed to work with auto-update set to false. I add a new ODMG test case for mapping classes on multiple joined tables (org.apache.ojb.odmg.InheritanceMultipleTableTest). Currently two tests fail (of 10). So mapping classes on multiple joined tables is not compatible and need to be fixed. regards, Armin Thanks in advance, Luis Cruz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Warnings in Managed Environment with RC7
It appears as though beginTransaction() is called on the given PersistenceBroker instance when it is created. Then, when a JTA commit operation occurs, it tries to release the connection (as shown in the stack trace below) but thinks that a local transaction is active. I assume that with a JTA transaction, no local transaction should be involved. I see there were changes in this (these messages appear new). Is anyone else seeing this behavior? Gary --- Gary <[EMAIL PROTECTED]> wrote: > No, I first commit or rollback the transaction, and > then close the PB. > > Gary > > --- Armin Waibel <[EMAIL PROTECTED]> wrote: > > Gary wrote: > > > > > Armin: > > > > > > Thanks for the quick reply. Do you guys have a > > > "contribute" site like SourceForge so I could > buy > > you > > > a beer? > > > > > > > Think I should avoid to drink alcohol, because > your > > problem seems really > > sophisticated ;-) > > > > > > > No, I wasn't using the "Sync" factory. When I > > change > > > to it, I get a new error: > > > 2004-06-15 15:19:29,798 ERROR [TCP > > > Connection(7)-172.24.54.129] Connection is in > > local > > > transaction, do a 'localCommit' or > 'localRollback' > > > beforeperform the connection release - rollback > > the > > > connection now > > > > > > (org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.releaseConnection(ConnectionManagerImpl.java)) > > > > > > > hmm, do you close the PB instance within the used > > method or before the > > tx demarcation ends? > > I assume you don't. > > > > regards, > > Armin > > > > > > > > > > > > > It has the following stack trace: > > > System Thread [TCP Connection(7)-172.24.54.129] > > > (Suspended) > > > ConnectionManagerImpl.releaseConnection() line: > > 295 > > > > > > > > > PersistenceBrokerFactorySyncImpl$PersistenceBrokerSyncImpl.beforeCompletion() > > > line: 240 > > > > > > > > > PersistenceBrokerFactorySyncImpl$TransactionBox.beforeCompletion() > > > line: 418 > > > RegisteredSyncs.distributeBefore() line: 110 > > > TransactionImpl.internalPrepare() line: 1211 > > > TransactionImpl.commit() line: 960 > > > TranManagerImpl.commit() line: 150 > > > TranManagerSet.commit() line: 182 > > > > > > My OJB.properties is as follows: > > > # > > > # OJB.properties -- configuration of the OJB > > runtime > > > environment > > > # Version: 1.0 > > > # (c) 2001, 2002, 2003 Apache Software > Foundation > > > # Author: Thomas Mahler and many others > > > # @version $Id: OJB.properties,v 1.70 2004/06/03 > > > 23:46:08 arminw Exp $ > > > # > > > > > > # > > > # repository file settings > > > > > > # > > > # The repositoryFile entry tells OJB to use this > > file > > > as as its standard mapping > > > # repository. The file is looked up from the > > > classpath. > > > # > > > repositoryFile=repository.xml > > > # > > > # If the useSerializedRepository entry is set to > > true, > > > OJB tries to load a > > > # serialized version of the repository for > > performance > > > reasons. > > > # if set to false, OJB always loads the xml > file. > > > # Setting this flag to true will accelerate the > > > startup sequence of OJB. > > > # If set to true changes to the repository.xml > > file > > > will only be detected > > > # after maually deleting the > > repository.xml.serialized > > > file. > > > useSerializedRepository=false > > > # > > > # If Repository serialization is used the entry > > > serializedRepositoryPath defines the > > > # directory where the Repository is written to > and > > > read from. > > > # this entry is used only when the > > > useSerializedRepository flag is set to true > > > # > > > serializedRepositoryPath=. > > > # > > > > > > # > > > # PersistenceBrokerFactory / PersistenceBroker > > > > > > # > > > # The PersistenceBrokerFactoryClass entry > decides > > > which concrete > > > # PersistenceBrokerFactory implemention is to be > > used. > > > > > > #PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl > > > # If in managed environment *only* the PB-api > was > > used > > > it's recommended to use this factory > > > # to enable the PersistenceBroker instances to > > > participate in the JTA transaction. This makes > > > # e.g. PBStateListener work properly in managed > > > environments. > > > > > > PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl > > > # > > > # > > > # The PersistenceBrokerClass entry decides which > > > concrete PersistenceBroker > > > # implementation is to be served by the > > > PersistenceBrokerFactory. > > > # This is the singlevm implementation: > > > > > > Persistenc
Re: RE : OJB and RMI
Bradford Pielech wrote: No, we didnt see any error messages relating to this, probably because the logging configuration is set in OJB.properties. Just to keep you updated: I changed the logging in CVS so that now you'll get a warning when the OJB.properties file was not found (before it was only a info message which was not visible with the default settings). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Warnings in Managed Environment with RC7
No, I first commit or rollback the transaction, and then close the PB. Gary --- Armin Waibel <[EMAIL PROTECTED]> wrote: > Gary wrote: > > > Armin: > > > > Thanks for the quick reply. Do you guys have a > > "contribute" site like SourceForge so I could buy > you > > a beer? > > > > Think I should avoid to drink alcohol, because your > problem seems really > sophisticated ;-) > > > > No, I wasn't using the "Sync" factory. When I > change > > to it, I get a new error: > > 2004-06-15 15:19:29,798 ERROR [TCP > > Connection(7)-172.24.54.129] Connection is in > local > > transaction, do a 'localCommit' or 'localRollback' > > beforeperform the connection release - rollback > the > > connection now > > > (org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.releaseConnection(ConnectionManagerImpl.java)) > > > > hmm, do you close the PB instance within the used > method or before the > tx demarcation ends? > I assume you don't. > > regards, > Armin > > > > > > > > It has the following stack trace: > > System Thread [TCP Connection(7)-172.24.54.129] > > (Suspended) > > ConnectionManagerImpl.releaseConnection() line: > 295 > > > > > PersistenceBrokerFactorySyncImpl$PersistenceBrokerSyncImpl.beforeCompletion() > > line: 240 > > > > > PersistenceBrokerFactorySyncImpl$TransactionBox.beforeCompletion() > > line: 418 > > RegisteredSyncs.distributeBefore() line: 110 > > TransactionImpl.internalPrepare() line: 1211 > > TransactionImpl.commit() line: 960 > > TranManagerImpl.commit() line: 150 > > TranManagerSet.commit() line: 182 > > > > My OJB.properties is as follows: > > # > > # OJB.properties -- configuration of the OJB > runtime > > environment > > # Version: 1.0 > > # (c) 2001, 2002, 2003 Apache Software Foundation > > # Author: Thomas Mahler and many others > > # @version $Id: OJB.properties,v 1.70 2004/06/03 > > 23:46:08 arminw Exp $ > > # > > > # > > # repository file settings > > > # > > # The repositoryFile entry tells OJB to use this > file > > as as its standard mapping > > # repository. The file is looked up from the > > classpath. > > # > > repositoryFile=repository.xml > > # > > # If the useSerializedRepository entry is set to > true, > > OJB tries to load a > > # serialized version of the repository for > performance > > reasons. > > # if set to false, OJB always loads the xml file. > > # Setting this flag to true will accelerate the > > startup sequence of OJB. > > # If set to true changes to the repository.xml > file > > will only be detected > > # after maually deleting the > repository.xml.serialized > > file. > > useSerializedRepository=false > > # > > # If Repository serialization is used the entry > > serializedRepositoryPath defines the > > # directory where the Repository is written to and > > read from. > > # this entry is used only when the > > useSerializedRepository flag is set to true > > # > > serializedRepositoryPath=. > > # > > > # > > # PersistenceBrokerFactory / PersistenceBroker > > > # > > # The PersistenceBrokerFactoryClass entry decides > > which concrete > > # PersistenceBrokerFactory implemention is to be > used. > > > #PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl > > # If in managed environment *only* the PB-api was > used > > it's recommended to use this factory > > # to enable the PersistenceBroker instances to > > participate in the JTA transaction. This makes > > # e.g. PBStateListener work properly in managed > > environments. > > > PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactorySyncImpl > > # > > # > > # The PersistenceBrokerClass entry decides which > > concrete PersistenceBroker > > # implementation is to be served by the > > PersistenceBrokerFactory. > > # This is the singlevm implementation: > > > PersistenceBrokerClass=edu.mayo.evolution.infrastructure.ojb.EvolutionPersistenceBrokerImpl > > > #PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl > > # > > # This is an implementation that uses Prevayler > > (prevayler.sf.net) as the persistent storage. > > # Using this implementation OJB works as a simple > > OODBMS > > > #PersistenceBrokerClass=org.apache.ojb.broker.prevayler.PBPrevaylerImpl > > # > > > # > > # PersistenceBroker pool > > > # > > # PersistenceBroker pool configuration > > # This pool uses the jakarta-commons-pool api. > > # There you can find things described in detail. > > # > > # maximum num
Re: Autodelete of from a Collection removed Items
Hi Björn, Björn Voigt wrote: Hello Group, I want to develope a form app with cocoon forms using ojb. I have a 1:n business-model like ProductGroup - Articles (one group has n article). I am using the PB-Api and i have realized the 1:n relation with a collection in ProductGroup. CocoonForms allows me to bind the model to a form. It is possible to describe a repeater, which shows the Article-Items inside the collection. So I defined a binding between an group and a form, a repeater shows all articles of a group. The repeater allows to insert and delete new Articles from the collection. Ok now my problem, If I get a Group-Object from DB with n Articles inside the collection, bind it to the form and remove some of it from the collection, how can I autodelete it from the article table, too? Is this possible with a one and only broker.store(group) How I have to define the mapping? Define a 1:n mapping between ProductGroup and Article and use a RemovalAware collection-class in collection-descriptor (Currently it's used by default, so no need to specify). Please see http://db.apache.org/ojb/docu/basic-technique.html#Mapping+1%3An+associations regards, Armin Thanks for your help Björn Voigt - 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: Manual Link and Unlink question
Hi Brad, Bradford Pielech wrote: Hello: This is a follow on to my question from last week where I have a graph structure where each graph node has a list of parents and children. I was trying to use the auto-update=object and auto-delete=object features, but it was not working well in my particular scenario (meaning there were not any bugs in OJB) so I am investigating switching to auto-update and auto-delete = none and linking / unlinking on my own. So here is my question: if I have object A and object B already stored in the database, how can I create or delete an M to N link between them in their indirection table? I know that the BrokerHelper link and unlink methods are the way to go, but I cannot see how to use it because, to me, it looks like you can only specify 1 side of the link. If you specify one side of the link this should be enough, because in indirection table the FK of both objects are inserted - or I'm missing something? For example: A, B already existing. // declare relation A.addBs(B) broker.beginTx broker.serviceBrokerHelper().link(A); broker.commitTx After this in indirection table the m:n relation between A and B should be stored. If you now call broker.retrieveAllReferences(B) Collection result = B.getAs() B now should contain A There is a test case in test suite ([db-ojb/src/test]) called org.apache.ojb.broker.M2NTest handle with m:n relation (automatic store and custom store with linking) regards, Armin Here is some rough sample code of what I want to do: --- PersistenceBroker pbroker = PersistenceBrokerFactory.defaultPersistenceBroker(); pbroker.beginTransaction(); pbroker.store(a); pbroker.commitTransaction(); //then some time later pbroker.beginTransaction(); pbroker.store(a); pbroker.commitTransaction(); //and finally even later pbroker.serviceBrokerHelper().link(a,b); //I know this method doesn't exist, but this is what I want to do. // or pbroker.serviceBrokerHelper().unlink(a,b); - Here is what the repository file for the DAGNode looks like: thank you! Brad - 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: Three level inheritance problem - Null data from the mostly nested table
Thanks Armin, now everything is ok. You saved my life : Dnia Tue, 15 Jun 2004 18:14:51 +0200, Armin Waibel <[EMAIL PROTECTED]> napisał: Hi Mariusz, did you try latest release (rc7)? Jakob fix a problem with inheritance between rc6 and rc7. regards, Armin Mariusz Wójcik wrote: Hi I try to realize three level of inheritance in OJB. My Class C extends Class B extends Class A each data are stored in separate tables (Table A, Table B, Table C) . I've implemented it. Inserts work fine. Inheritance is OK, all data are stored in tables.All references are OK. I have problems with quering objects. I try to get all C Class object. In each object I can't get access to data which are stored in A Table (they are null). But when I try to list A Class Objects, their data are complete. I noticed very strange thing. When I try to list object in this order, both methods works fine (Collection returned by method getCClassObject is OK, all object,s data are complete): ... Collection AClassObjects=getAClassObjects(); //getting A Class objects Collection CClassObjects=getCClassObjects(); //getting C Class objects ... But my problems start when I try to invoke only one method: .. Collection CClassObjects=getCClassObjects(); //getting C Class object .. Object of CClassObjects collection haven't data stored in A table (the mostly nested)... I have to use the other solution... but it doesn't work Please help me ... Best regards mario - 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] -- Używam M2 - innowacyjnego klienta poczty wbudowanego w Operę: http://www.opera.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
Thomas Something go wrong with the debug, (I get no more info) I try to find out and I send the stack. I will need time. Thank you for your help. Andre Thomas Dudziak wrote: Hale India wrote: Hi Thomas I have built after changing jar to jar-debug Then I have rebuilt my project using the new jars but when I run my appl I don't get more info. You should get more info because the stacktrace now contains line numbers which help locating the place in OJB where the error happens. Please post this *complete* stacktrace. 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: Problems getting ojb-blank
Hale India wrote: Hi Thomas I have built after changing jar to jar-debug Then I have rebuilt my project using the new jars but when I run my appl I don't get more info. You should get more info because the stacktrace now contains line numbers which help locating the place in OJB where the error happens. Please post this *complete* stacktrace. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
Hi Thomas I have built after changing jar to jar-debug Then I have rebuilt my project using the new jars but when I run my appl I don't get more info. Can you help me? Andre --- Thomas Dudziak <[EMAIL PROTECTED]> wrote: > Hale India wrote: > > >Hi Thomas > > > >Yes I updae the OJB.properties. > > > >I forget to give you the most important part of > error > >message : > >Caused by: java.lang.NullPointerException > >at > >org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown > >Source) > >at > >org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown > >Source) > >at > >org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.(Unknown > >Source) > >... 19 more > > > >Maybe it can hep. > > > > > > > Could you change OJB's build.xml file so that the > 'ojb-blank' target > depends on 'jar-debug' (not on 'jar'), and then > rerun your test and post > the complete stacktrace ? > > 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]
Manual Link and Unlink question
Hello: This is a follow on to my question from last week where I have a graph structure where each graph node has a list of parents and children. I was trying to use the auto-update=object and auto-delete=object features, but it was not working well in my particular scenario (meaning there were not any bugs in OJB) so I am investigating switching to auto-update and auto-delete = none and linking / unlinking on my own. So here is my question: if I have object A and object B already stored in the database, how can I create or delete an M to N link between them in their indirection table? I know that the BrokerHelper link and unlink methods are the way to go, but I cannot see how to use it because, to me, it looks like you can only specify 1 side of the link. Here is some rough sample code of what I want to do: --- PersistenceBroker pbroker = PersistenceBrokerFactory.defaultPersistenceBroker(); pbroker.beginTransaction(); pbroker.store(a); pbroker.commitTransaction(); //then some time later pbroker.beginTransaction(); pbroker.store(a); pbroker.commitTransaction(); //and finally even later pbroker.serviceBrokerHelper().link(a,b); //I know this method doesn't exist, but this is what I want to do. // or pbroker.serviceBrokerHelper().unlink(a,b); - Here is what the repository file for the DAGNode looks like: thank you! Brad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
Hi Thomas I will change to jar-debug. I have been able to run tutorial1 example. So it is application dependent. To run tutorial1 I have been obliged to change dbalias to ojb (instead of OJB) this seems to confirm the case problem. Thanks for your help. Andre Legendre --- Thomas Dudziak <[EMAIL PROTECTED]> wrote: > Hale India wrote: > > >Hi Thomas > > > >Yes I updae the OJB.properties. > > > >I forget to give you the most important part of > error > >message : > >Caused by: java.lang.NullPointerException > >at > >org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown > >Source) > >at > >org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown > >Source) > >at > >org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.(Unknown > >Source) > >... 19 more > > > >Maybe it can hep. > > > > > > > Could you change OJB's build.xml file so that the > 'ojb-blank' target > depends on 'jar-debug' (not on 'jar'), and then > rerun your test and post > the complete stacktrace ? > > 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]
Autodelete of from a Collection removed Items
Hello Group, I want to develope a form app with cocoon forms using ojb. I have a 1:n business-model like ProductGroup - Articles (one group has n article). I am using the PB-Api and i have realized the 1:n relation with a collection in ProductGroup. CocoonForms allows me to bind the model to a form. It is possible to describe a repeater, which shows the Article-Items inside the collection. So I defined a binding between an group and a form, a repeater shows all articles of a group. The repeater allows to insert and delete new Articles from the collection. Ok now my problem, If I get a Group-Object from DB with n Articles inside the collection, bind it to the form and remove some of it from the collection, how can I autodelete it from the article table, too? Is this possible with a one and only broker.store(group) How I have to define the mapping? Thanks for your help Björn Voigt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
Hale India wrote: Hi Thomas Yes I updae the OJB.properties. I forget to give you the most important part of error message : Caused by: java.lang.NullPointerException at org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown Source) at org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.(Unknown Source) ... 19 more Maybe it can hep. Could you change OJB's build.xml file so that the 'ojb-blank' target depends on 'jar-debug' (not on 'jar'), and then rerun your test and post the complete stacktrace ? Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
Hi Thomas Yes I updae the OJB.properties. I forget to give you the most important part of error message : Caused by: java.lang.NullPointerException at org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown Source) at org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.(Unknown Source) ... 19 more Maybe it can hep. Thank's for your help Andre --- Thomas Dudziak <[EMAIL PROTECTED]> wrote: > A Leg wrote: > > > Hi Thomas > > Finally I follow your second option, I enter > database elements by > > hand, and I got the ojb-blank.jar > > > > I recompiled my project, and adapt all > configuration files. > > > > When I run m project I get the following error : > > > > WARN: Value > "org.apache.ojb.odmg.collections.DListImpl_2" is > illegal > > for key "OqlCollectionClass" (should be a class, > using default value > > class org.apache.ojb.odmg.collections.DListImpl) > > java.lang.ExceptionInInitializerError > > at java.lang.Class.forName0(Native Method) > > at java.lang.Class.forName(Class.java:219) > > at > org.apache.ojb.broker.util.ClassHelper.getClass(Unknown > Source) > > at > org.apache.ojb.broker.util.ClassHelper.getClass(Unknown > Source) > > at > > > org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown > > > Source) > > at > > > org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown > > > Source) > > at > > > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown > > > Source) > > at > > > org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown > > > Source) > > at > > > org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown > > > Source) > > > > My project was good working with rc4. > > May be I should first run some tests on ojb, to > validate my install. > > Did you update your OJB.properties file, or is the > one from rc4 ? Also, > you can specify the mentioned default value for the > 'OqlCollectionClass' > in the OJB.properties file to remove this warning. > > 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]
Migrating from Castor
Hi, I'm thinking to migrate from Castor to OJB, in Castor I use long transactions, and OIDs, are put by my own OIDs manager, I know that this things are supported by OJB. in this list anyone migrate from Castor? any tip to migrate or no? TIA Clóvis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Complex mapping problem
Hi all, I'm just looking for some advice regarding mapping a reasonably complex class with OJB. The basis of the problem is the structure of a "User" transfer class. The class includes name, password and so on. However, it also includes two Collections; a vector of "permissions" and a vector of "permission holders". The permissions class is a simple one and can be handled with a many to many relationship. The permission holder is more complex and defined by an interface. It may be implemented as a Role, Group or User. Hence a User (or Role or Group) is a permission holder and can also hold other permission holders. This facilitates quite a rich structure of permissions. The question relates to the possibility of mapping a single vector (PermissionHolders) within a (say) User to the three RDB data sets that define Roles, Groups and Users. Of course it is possible that the basic structure is flawed! Thanks in anticipation, MarcusUnix Systems Administrator +61 3 9873 0155 +61 3 9720 7467 (fax) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
A Leg wrote: Hi Thomas Finally I follow your second option, I enter database elements by hand, and I got the ojb-blank.jar I recompiled my project, and adapt all configuration files. When I run m project I get the following error : WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is illegal for key "OqlCollectionClass" (should be a class, using default value class org.apache.ojb.odmg.collections.DListImpl) java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:219) at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source) at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source) at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown Source) at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source) My project was good working with rc4. May be I should first run some tests on ojb, to validate my install. Did you update your OJB.properties file, or is the one from rc4 ? Also, you can specify the mentioned default value for the 'OqlCollectionClass' in the OJB.properties file to remove this warning. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
Hi Thomas Finally I follow your second option, I enter database elements by hand, and I got the ojb-blank.jar I recompiled my project, and adapt all configuration files. When I run m project I get the following error : WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is illegal for key "OqlCollectionClass" (should be a class, using default value class org.apache.ojb.odmg.collections.DListImpl) java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:219) at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source) at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source) at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown Source) at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source) My project was good working with rc4. May be I should first run some tests on ojb, to validate my install. Any advice will help me. Andre Thomas Dudziak wrote: Hale India wrote: Hi I still try to get running my project using ojb 1.0rc6. When I run : ant ojb-blank I get : [torque-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package sql-template: create-db-check: create-db: datasql: [echo] +---+ [echo] | | [echo] | Generating SQL from data XML ! | [echo] | Woo hoo! | [echo] | | [echo] +---+ [torque-data-sql] Using contextProperties file: /home/rcs/Master/extern/java/db-ojb/build.properties [torque-data-sql] Using classpath [torque-data-sql] Generating to file /home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql [torque-data-sql] Parsing file: 'ojbtest-schema.xml' [torque-data-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [torque-data-sql] Resolver: used /home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd insert-sql: [torque-sql-exec] Our new url -> jdbc:postgresql://localhost/OJB BUILD FAILED /home/rcs/Master/extern/java/db-ojb/build.xml:386: Following error occured while executing this line /home/rcs/Master/extern/java/db-ojb/build-torque.xml:339: org.postgresql.util.PSQLException: Backend start-up failed: org.postgresql.util.PSQLException: FATAL: database "OJB" does not exist Well, you have two options: * If you want to roll database creation (e.g. CREATE DATABASE) and initialization (CREATE TABLE) on your own, you can simply remove the dependency of the 'ojb-blank' target on the 'prepare-testdb' target in the build.xml buildfile. * If you want to use Torque for database creation and initialization (which makes things easier if you plan to use your project with different databases), then you'll have to resolve the above error. I'm no PostgreSQL expert, but it seems that Torque is not able to create the database, but you can do this manually in PostgreSQL (the database name is OJB). 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: Problems getting ojb-blank
A Leg wrote: Hi Thomas, I am not sure but it seems that somewhere, it ahs been some problems because the database name is upper case. It seems to give some problem somewhere. This is likely with PostgreSQL since you're probably using Linux or Unix. In the ojb-blank project, you specify the database url in the build.properties file (using urlDbalias, in your case it would be '//localhost/OJB'). Then, the build process will create a corresponding jdbc connection descriptor (repository_database.xml). So, if you create the database manually, all you'd have to do is to specify the database name in the urlDbalias in the build.properties file that you used with psql (in the same case). I am trying to create everything by hand. Is it another place than build files to know what t I have to create ? You might need OJB's internal tables, they are required by several components of OJB (ODMG, some sequence managers etc.). You should try first without them, but if that does not work, you'll have to add them. I'm no PostgreSQL user, but there is surely someone on the list that can send you the PostgreSQL table definitions for them. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems getting ojb-blank
Hi Thomas, I am not sure but it seems that somewhere, it ahs been some problems because the database name is upper case. It seems to give some problem somewhere. I am trying to create everything by hand. Is it another place than build files to know what t I have to create ? Best regards Andre Legendre Thomas Dudziak wrote: Hale India wrote: Hi I still try to get running my project using ojb 1.0rc6. When I run : ant ojb-blank I get : [torque-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package sql-template: create-db-check: create-db: datasql: [echo] +---+ [echo] | | [echo] | Generating SQL from data XML ! | [echo] | Woo hoo! | [echo] | | [echo] +---+ [torque-data-sql] Using contextProperties file: /home/rcs/Master/extern/java/db-ojb/build.properties [torque-data-sql] Using classpath [torque-data-sql] Generating to file /home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql [torque-data-sql] Parsing file: 'ojbtest-schema.xml' [torque-data-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [torque-data-sql] Resolver: used /home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd insert-sql: [torque-sql-exec] Our new url -> jdbc:postgresql://localhost/OJB BUILD FAILED /home/rcs/Master/extern/java/db-ojb/build.xml:386: Following error occured while executing this line /home/rcs/Master/extern/java/db-ojb/build-torque.xml:339: org.postgresql.util.PSQLException: Backend start-up failed: org.postgresql.util.PSQLException: FATAL: database "OJB" does not exist Well, you have two options: * If you want to roll database creation (e.g. CREATE DATABASE) and initialization (CREATE TABLE) on your own, you can simply remove the dependency of the 'ojb-blank' target on the 'prepare-testdb' target in the build.xml buildfile. * If you want to use Torque for database creation and initialization (which makes things easier if you plan to use your project with different databases), then you'll have to resolve the above error. I'm no PostgreSQL expert, but it seems that Torque is not able to create the database, but you can do this manually in PostgreSQL (the database name is OJB). 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: Problems getting ojb-blank
Hale India wrote: Hi I still try to get running my project using ojb 1.0rc6. When I run : ant ojb-blank I get : [torque-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package sql-template: create-db-check: create-db: datasql: [echo] +---+ [echo] | | [echo] | Generating SQL from data XML ! | [echo] | Woo hoo! | [echo] | | [echo] +---+ [torque-data-sql] Using contextProperties file: /home/rcs/Master/extern/java/db-ojb/build.properties [torque-data-sql] Using classpath [torque-data-sql] Generating to file /home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql [torque-data-sql] Parsing file: 'ojbtest-schema.xml' [torque-data-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [torque-data-sql] Resolver: used /home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd insert-sql: [torque-sql-exec] Our new url -> jdbc:postgresql://localhost/OJB BUILD FAILED /home/rcs/Master/extern/java/db-ojb/build.xml:386: Following error occured while executing this line /home/rcs/Master/extern/java/db-ojb/build-torque.xml:339: org.postgresql.util.PSQLException: Backend start-up failed: org.postgresql.util.PSQLException: FATAL: database "OJB" does not exist Well, you have two options: * If you want to roll database creation (e.g. CREATE DATABASE) and initialization (CREATE TABLE) on your own, you can simply remove the dependency of the 'ojb-blank' target on the 'prepare-testdb' target in the build.xml buildfile. * If you want to use Torque for database creation and initialization (which makes things easier if you plan to use your project with different databases), then you'll have to resolve the above error. I'm no PostgreSQL expert, but it seems that Torque is not able to create the database, but you can do this manually in PostgreSQL (the database name is OJB). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems getting ojb-blank
Hi I still try to get running my project using ojb 1.0rc6. When I run : ant ojb-blank I get : [torque-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package sql-template: create-db-check: create-db: datasql: [echo] +---+ [echo] | | [echo] | Generating SQL from data XML ! | [echo] | Woo hoo! | [echo] | | [echo] +---+ [torque-data-sql] Using contextProperties file: /home/rcs/Master/extern/java/db-ojb/build.properties [torque-data-sql] Using classpath [torque-data-sql] Generating to file /home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql [torque-data-sql] Parsing file: 'ojbtest-schema.xml' [torque-data-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [torque-data-sql] Resolver: used /home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd insert-sql: [torque-sql-exec] Our new url -> jdbc:postgresql://localhost/OJB BUILD FAILED /home/rcs/Master/extern/java/db-ojb/build.xml:386: Following error occured while executing this line /home/rcs/Master/extern/java/db-ojb/build-torque.xml:339: org.postgresql.util.PSQLException: Backend start-up failed: org.postgresql.util.PSQLException: FATAL: database "OJB" does not exist Thnk's for any help Andre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems getting ojb-blank
Hi I still try to get running my project using ojb 1.0rc6. When I run : ant ojb-blank I get : [torque-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package sql-template: create-db-check: create-db: datasql: [echo] +---+ [echo] | | [echo] | Generating SQL from data XML ! | [echo] | Woo hoo! | [echo] | | [echo] +---+ [torque-data-sql] Using contextProperties file: /home/rcs/Master/extern/java/db-ojb/build.properties [torque-data-sql] Using classpath [torque-data-sql] Generating to file /home/rcs/Master/extern/java/db-ojb/target/test/sql/ojbtest-data.sql [torque-data-sql] Parsing file: 'ojbtest-schema.xml' [torque-data-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [torque-data-sql] Resolver: used /home/rcs/Master/extern/java/db-ojb/target/test/ojbtest-data.dtd insert-sql: [torque-sql-exec] Our new url -> jdbc:postgresql://localhost/OJB BUILD FAILED /home/rcs/Master/extern/java/db-ojb/build.xml:386: Following error occured while executing this line /home/rcs/Master/extern/java/db-ojb/build-torque.xml:339: org.postgresql.util.PSQLException: Backend start-up failed: org.postgresql.util.PSQLException: FATAL: database "OJB" does not exist Thnk's for any help Andre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]