objectbridge-users Mailing List for ObJectRelationalBridge
Brought to you by:
thma
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(32) |
May
(86) |
Jun
(53) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jason M. <mc...@na...> - 2003-01-24 00:15:27
|
I have a table that has an holds reference to an intermediary table, so it references both primary keys of the other table as foreign keys. When I used the reverse-db tool it gave me this: where 1 and 2 are the combined foeign key. <reference-descriptor name="resOutputResConfigRefID" class-ref="org.nacse.nees.data.resource.ResourCeconfiguration" auto-retrieve="false" auto-update="false" auto-delete="false"> <foreignkey field-id-ref="1 2"/> Is this the right syntax? Jason |
From: Charles A. <cha...@hp...> - 2002-08-28 15:00:47
|
> hi, > I am using OJB0.9.5 in a webapp running on tomcat. I am not > using the J2EE persistance broker but the default one. I am > getting an Error since the TransactionImpl are created with a > null Database. The database is internally stored per thread. You must open the database on each thread to avoid this error. This is not a big overhead, as opening a database is not a costly operation. See http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-dev@jakarta.apache .org&msgId=435801 for more discussion This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. |
From: Stephane F. <sf...@un...> - 2002-08-28 14:43:46
|
hi, I am using OJB0.9.5 in a webapp running on tomcat. I am not using the J2EE = persistance broker but the default one. I am getting an Error since the = TransactionImpl are created with a null Database. The db is open and exists, I can use it for queries but some times when I = try to get a new transaction, I am getting an Error. Is this because I am not using the J2EE broker? I am using OJB since a few = month and I never got this problem, do the new release impose the use of = the J2EE mode? The LogMessage I get is the following : [org.apache.ojb.odmg.TransactionImpl] WARN: TransactionImpl created with = null DatabaseImpl. The Error I get is the following : "java.lang.NullPointerException at org.apache.ojb.odmg.TransactionImpl.getBroker(Unknown Source)" Thx, St=E9phane |
From: Jason M. <mc...@na...> - 2002-08-01 19:13:35
|
OK, I upgraded to the new version, and made changes per the new stuff. I'm having some sort of problem with the persistence broker pool. When I start my app I get the following errors. Anyone have ANY idea what I'm doing wrong? cuz I can't figure it out. -Jason [BOOT] INFO: OJB.properties: file:/ant/downloads/IDEA/IdeaProjectsTemp/DBDiscover/WEB-INF/classes/OJB.properties 2002-08-01 12:07:16,507 [tcpConnection-8080-0] FATAL DEFAULT (?:?) - java.lang.NullPointerException 2002-08-01 12:07:16,574 [tcpConnection-8080-0] ERROR org.nacse.dbd.data.DataObjectBroker (DataObjectBroker.java:24) - Throwable Exception in DataObjectBroker Constructor: org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unknown Source) AND org.apache.ojb.broker.PBFactoryException: Creation of a new PB instance failed at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBrokerInstance(Unknown Source) at org.apache.ojb.broker.ta.PBKeyedPoolableObjectFactory.makeObject(Unknown Source) at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown Source) at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unknown Source) AND java.lang.reflect.InvocationTargetException: org.apache.ojb.broker.metadata.MetadataException at org.apache.ojb.broker.metadata.DescriptorRepository.getInstance(Unknown Source) at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.<init>(Unknown Source) at java.lang.reflect.Constructor.newInstance(Native Method) at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createNewBrokerInstance(Unknown Source) at org.apache.ojb.broker.ta.PBKeyedPoolableObjectFactory.makeObject(Unknown Source) at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown Source) at org.apache.ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unknown Source) |
From: Thomas M. <tho...@ho...> - 2002-06-20 05:13:07
|
Hi all, The shift to Jakarta is now complete. OJB is now an official Jakarta subproject. Our new url is : http://jakarta.apache.org/ojb All OJB related activities will be organized in the Jakarta environment. The SourceForge presence will be reduced to a minimum. All OJB users and developers are requested to register to our new Jakarta mailinglists, as we won't maintain the sourceforge mailinglists. Here is the link to the mailinglist subscription page: http://jakarta.apache.org/ojb/mail-lists.html I shut down all Mailinglists, Tracker and Forum functionality on our old SourceForge site. best regards, Thomas |
From: Vullanki, S. <Sri...@co...> - 2002-06-19 17:57:57
|
Hi, I want to map single class to two different tables. How to define this in the xml. Such mapped class is in turn used in 1:N mapping. So in the collection descriptor atttribute i should be able to defferentiate these two classes.(one is mapped to table X and the other is mapped to table Y) Is this kind of mapping is possible in OJB. Thanks Srividya |
From: Grim S. <gri...@ya...> - 2002-06-19 05:20:02
|
Thanks for the rapid patch... OJB is now generating SQL, however the last insert is: INSERT INTO ACCOUNT_ROLE (ACCOUNT_OID,ROLE_OID) VALUES ( 0,1,0 ) I'm no sure what the third 0 is for... While the Account<->Role is M-N, the Person->Account is 1-N, but the Person OID shouldn't be part of the mapping between Account<->Role. Do I need a third field for the PERSON_OID? or is my code messed up somehow? repository_user.xml is attached... Okay, it's the same message I posted a few days ago... with the exception fo this line and the following: Point me in the right direction and I'll fix it myself.. don't mind at all.. just don't feel like going through the entire bit right now :) ===== Grim Shieldsson (James A Barrows) Acting Chieftain of Clan StormWolf Barbarian Freehold Alliance "The real destroyer of the liberties of the people is he who spreads among them bounties, donations and benefits." --Plutarch __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com |
From: Jason M. <mc...@na...> - 2002-06-18 16:29:25
|
One note on this: It is likely that, as with all of Oracle's products, it is only available for _download_ free of charge. You can test with it, develop with it, etc. However, you have to fork up the cash when you want to go to production run time. So the article is a little misleading. This is how it works with Oracle 9i JDeveloper, 9ias, and the databases. Personally, I've always liked the way Oracle does this from a developer standpoint as it lets me play with their toys and learn them. -Newt On Tue, 2002-06-18 at 09:16, Jerome Jacobsen wrote: > Saw this news item and thought it would be of interest here. > > > JavaDevelopersJournal > http://www.JavaDevelopersJournal.com > > > > (June 18, 2002) - Oracle has purchased the TopLink family of products, > developed and supported out of WebGain Canada, a division of WebGain Inc. of > Santa Clara, CA. The acquisition includes the TopLink technology, the > TopLink family of products and all TopLink employees (about 90 in all, > including all WebGain Canada staff and some employees in the San Francisco > and Raleigh, NC offices). The deal was final on June 13, 2002. > > One of Oracle's key objectives is to provide productive and high performance > solutions to the Java/J2EE Java development community. TopLink products fill > a critical need for storing business objects and components in a relational > database (RDB), while maximizing Java developer productivity. Developers can > expect to save 30-40 percent of project resources using this > Object-Relational mapping software product. > > There are 700 licensed TopLink customers, of which 400 were supported by > WebGain. Oracle has assumed all of the WebGain end-user agreements and some > select OEM agreements. A large number of large enterprise customers are > using TopLink products extensively, including BMW, Daimler, BP, etc. > > The TopLink product itself is unchanged. As with all Oracle products, it is > available for download, free of charge, on Oracle Technology Network (OTN), > as well as through all of Oracle's normal business channels. It provides a > robust, feature-rich framework that can be re-used on multiple projects. > TopLink is in production worldwide in industries such as aerospace, > automotive, banking, e-commerce, health care, insurance, manufacturing, > pharmaceutical, system integration, and transportation logistics. > > In an enterprise Java environment, one of the most formidable challenges is > storing business objects and components in a relational database (RDB). > TopLink makes application development more productive by offering an easy to > use mapping workbench that maps the Java objects to relational databases and > by simplifying one of the most difficult aspects of developing applications: > persisting information to the database. Using TopLink, developers gain the > flexibility to map objects and EJBs to a relational database schema with > minimal impact on ideal application design or database integrity. As a > result, developers can focus on addressing business needs rather than > building infrastructure. TopLink is built on Java Database Connectivity > (JDBC) and is portable across any JDBC-compliant database, including > Oracle's Database, DB2, SQL Server, Sybase, Informix, and Access. > > For more information, see Oracle's Web site, www.oracle.com. > > > JavaDevelopersJournal > http://www.JavaDevelopersJournal.com > |
From: Jerome J. <jer...@ge...> - 2002-06-18 16:17:26
|
Saw this news item and thought it would be of interest here. JavaDevelopersJournal http://www.JavaDevelopersJournal.com (June 18, 2002) - Oracle has purchased the TopLink family of products, developed and supported out of WebGain Canada, a division of WebGain Inc. of Santa Clara, CA. The acquisition includes the TopLink technology, the TopLink family of products and all TopLink employees (about 90 in all, including all WebGain Canada staff and some employees in the San Francisco and Raleigh, NC offices). The deal was final on June 13, 2002. One of Oracle's key objectives is to provide productive and high performance solutions to the Java/J2EE Java development community. TopLink products fill a critical need for storing business objects and components in a relational database (RDB), while maximizing Java developer productivity. Developers can expect to save 30-40 percent of project resources using this Object-Relational mapping software product. There are 700 licensed TopLink customers, of which 400 were supported by WebGain. Oracle has assumed all of the WebGain end-user agreements and some select OEM agreements. A large number of large enterprise customers are using TopLink products extensively, including BMW, Daimler, BP, etc. The TopLink product itself is unchanged. As with all Oracle products, it is available for download, free of charge, on Oracle Technology Network (OTN), as well as through all of Oracle's normal business channels. It provides a robust, feature-rich framework that can be re-used on multiple projects. TopLink is in production worldwide in industries such as aerospace, automotive, banking, e-commerce, health care, insurance, manufacturing, pharmaceutical, system integration, and transportation logistics. In an enterprise Java environment, one of the most formidable challenges is storing business objects and components in a relational database (RDB). TopLink makes application development more productive by offering an easy to use mapping workbench that maps the Java objects to relational databases and by simplifying one of the most difficult aspects of developing applications: persisting information to the database. Using TopLink, developers gain the flexibility to map objects and EJBs to a relational database schema with minimal impact on ideal application design or database integrity. As a result, developers can focus on addressing business needs rather than building infrastructure. TopLink is built on Java Database Connectivity (JDBC) and is portable across any JDBC-compliant database, including Oracle's Database, DB2, SQL Server, Sybase, Informix, and Access. For more information, see Oracle's Web site, www.oracle.com. JavaDevelopersJournal http://www.JavaDevelopersJournal.com |
From: Matthew b. <mat...@ya...> - 2002-06-18 05:43:53
|
Close. In order to make sequence generators work for all cases, I needed to change the behaviour to be unique to the table that the class is mapped to, and not the class itself as multiple classes can be mapped to one table. Sequence generators will work normally for this situation now. m Arvind Gudipati <Arv...@PA...> wrote: Im pretty new to OJB myself.. but i will try to answer yr question (experts please correct me if im wrong!!) OJB uses a special sequence tables to create the unique id's for each class. This default behaviour can be changed.. If you want to store/insert 2 classes to one table, you's have to change the default sequence generation mechanism... However the problem comes when you want to retrive the data.. how does OJB knows which class to instantiate for what? There is also a way for OJB to specify the same.... but this requires modification of your database table by adding a special column .... take a look at examples in test directory of OJB distribution... class test.A test.AB and test.B are all stored in one table AB_TABLE ... but this is an example of inheritence... however i think it can also be used in situations elsewhere as yours... Hope this solves your problem... Arvind -----Original Message----- From: Matthew baird [mailto:mat...@ya...] Sent: Friday, June 14, 2002 5:54 PM To: Andrew Geery; 'obj...@li...' Subject: Re: [ojb-users] mapping multiple objects transparently to a single table I don't have the answer offhand (I'm probably the most responsible for multiple objects mapped to a single table right now), but I'll get around to writing a test case for it soon, unless of course you want to write one for me. Once the test case is done, I'll look at fixing it. I'll fix it faster if I have the test case done sooner... hint hint. m Andrew Geery <Gee...@do...> wrote: I was wondering if it is possible to map multiple objects to a single table transparently. For example: Object A maps to table T. Object B contains a reference to object A and also maps to table T. How can I set up the repository.xml file so that when I call broker.store( B ); object A is also stored? The problem I am running into is that the database complains that the id column is specfied more than once in the INSERT statement Can this even be done? If it can, a short example would be wonderful. Thanks Andrew _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users --------------------------------- Do You Yahoo!? Sign-up for Video Highlights of 2002 FIFA World Cup ***************************************************************************************** This E-mail is from PANACYA Inc. The E-mail and any files transmitted with it are confidential and may also be privileged and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized direct or indirect dissemination, distribution or copying of this message and any attachments is strictly prohibited. If you have received the E-mail in error please notify adm...@pa... or telephone (410) 910-3300. **************************************************************************************** --------------------------------- Do You Yahoo!? Sign-up for Video Highlights of 2002 FIFA World Cup |
From: Arvind G. <Arv...@PA...> - 2002-06-17 21:55:32
|
Im pretty new to OJB myself.. but i will try to answer yr question (experts please correct me if im wrong!!) OJB uses a special sequence tables to create the unique id's for each class. This default behaviour can be changed.. If you want to store/insert 2 classes to one table, you's have to change the default sequence generation mechanism... However the problem comes when you want to retrive the data.. how does OJB knows which class to instantiate for what? There is also a way for OJB to specify the same.... but this requires modification of your database table by adding a special column .... take a look at examples in test directory of OJB distribution... class test.A test.AB and test.B are all stored in one table AB_TABLE ... but this is an example of inheritence... however i think it can also be used in situations elsewhere as yours... Hope this solves your problem... Arvind -----Original Message----- From: Matthew baird [mailto:mat...@ya...] Sent: Friday, June 14, 2002 5:54 PM To: Andrew Geery; 'obj...@li...' Subject: Re: [ojb-users] mapping multiple objects transparently to a single table I don't have the answer offhand (I'm probably the most responsible for multiple objects mapped to a single table right now), but I'll get around to writing a test case for it soon, unless of course you want to write one for me. Once the test case is done, I'll look at fixing it. I'll fix it faster if I have the test case done sooner... hint hint. m Andrew Geery <Gee...@do...> wrote: I was wondering if it is possible to map multiple objects to a single table transparently. For example: Object A maps to table T. Object B contains a reference to object A and also maps to table T. How can I set up the repository.xml file so that when I call broker.store( B ); object A is also stored? The problem I am running into is that the database complains that the id column is specfied more than once in the INSERT statement Can this even be done? If it can, a short example would be wonderful. Thanks Andrew _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users _____ Do You Yahoo!? Sign-up <http://rd.yahoo.com/welcome/*http://fifaworldcup.yahoo.com/fc/en/spl> for Video Highlights of 2002 FIFA World Cup **************************************************************************** ************* This E-mail is from PANACYA Inc. The E-mail and any files transmitted with it are confidential and may also be privileged and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized direct or indirect dissemination, distribution or copying of this message and any attachments is strictly prohibited. If you have received the E-mail in error please notify adm...@pa... or telephone (410) 910-3300. **************************************************************************** ************ |
From: Bradley A. S. <br...@ba...> - 2002-06-17 21:33:13
|
I found a workaround by combining the two repository files and specifying the JDBC connection descriptor for each class descriptor in each of the two packages. Will putting a connection descriptor in each class descriptor have any consequences? I look forward to the next release. Then I'll be able to use the simpler solution. Regardless of these minor glitches, I am very happy with OJB. It has filled a need which I have tried to fill in the past with other products and was left unsatisfied. Thanks, Bradley ----- Original Message ----- From: "Thomas Mahler" <tho...@ho...> To: "Bradley A. Smith" <br...@ba...> Cc: <obj...@li...> Sent: Monday, June 17, 2002 2:00 PM Subject: Re: [ojb-users] Using multiple repository.xml > WIth OJB 0.9 that's not possible. > But we are working on this issue. will be fixed in the next public release! > > cheers, > Thomas > > Bradley A. Smith wrote: > > Is is possible to use multiple repository.xml files? > > > > For example, > > > > broker = PersistenceBrokerFactory.createPersistenceBroker("first.xml"); > > // Use broker to access first database > > ... > > PersistenceBrokerFactory.releaseInstance(broker); > > > > broker = PersistenceBrokerFactory.createPersistenceBroker("second.xml"); > > // Use broker to access second database > > ... > > > > I have two packages using OJB which I would like to configure with different > > xml files. When I test each package individually, all tests pass. However, > > when I test them together (by creating a JUnit TestSuite), I receive "not > > found in OJB Repository" errors. Why? > > > > > > Thanks, > > Bradley > > > > > > > > _______________________________________________________________ > > > > Sponsored by: > > ThinkGeek at http://www.ThinkGeek.com/ > > _______________________________________________ > > Objectbridge-users mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > > > > > > > |
From: Thomas M. <tho...@ho...> - 2002-06-17 21:00:06
|
WIth OJB 0.9 that's not possible. But we are working on this issue. will be fixed in the next public release! cheers, Thomas Bradley A. Smith wrote: > Is is possible to use multiple repository.xml files? > > For example, > > broker = PersistenceBrokerFactory.createPersistenceBroker("first.xml"); > // Use broker to access first database > ... > PersistenceBrokerFactory.releaseInstance(broker); > > broker = PersistenceBrokerFactory.createPersistenceBroker("second.xml"); > // Use broker to access second database > ... > > I have two packages using OJB which I would like to configure with different > xml files. When I test each package individually, all tests pass. However, > when I test them together (by creating a JUnit TestSuite), I receive "not > found in OJB Repository" errors. Why? > > > Thanks, > Bradley > > > > _______________________________________________________________ > > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > |
From: Bradley A. S. <br...@ba...> - 2002-06-17 17:36:39
|
Is is possible to use multiple repository.xml files? For example, broker = PersistenceBrokerFactory.createPersistenceBroker("first.xml"); // Use broker to access first database ... PersistenceBrokerFactory.releaseInstance(broker); broker = PersistenceBrokerFactory.createPersistenceBroker("second.xml"); // Use broker to access second database ... I have two packages using OJB which I would like to configure with different xml files. When I test each package individually, all tests pass. However, when I test them together (by creating a JUnit TestSuite), I receive "not found in OJB Repository" errors. Why? Thanks, Bradley |
From: Christoph S. <cs...@mc...> - 2002-06-17 12:26:37
|
Hi All! I am trying to use ojb with oracle, but i have some problems. * i cant create the odmg tables with torque. I created an oracle.profile, and entered my db info, but when torque tried to insert data, i got a foreign key violation. (i tried with build.xml and build-maven.xml) * Oracle returns numeric data as BigDecimal, and I have it declared as Integer in my Objects, so I get a IllegalArgumentException. Must i declare my numeric elements as BigDecimal, or is there a workaround? Dont kill me if this is all documented somewhere, but I searched for quite some time. Thanks in advance for your help! -chris |
From: Thomas M. <tho...@ho...> - 2002-06-16 07:06:10
|
-------- Original Message -------- Subject: Help with OBJ Date: Fri, 14 Jun 2002 10:21:31 -0400 From: "Warmuz, Peter" <Pet...@ci...> To: "'th...@us...'" <th...@us...> Hi Thomas, How are you? Through word of mouth and through great reviews I have heard about the object/relational bridge. So I decided to that I just might use it for my one of projects here at work. As not too many of us like to playing with SQL statements. So.. off I went to explore the object/relational bridge. However, I'm having a problem and I'm hoping you could assist me. I created a use case that is very similar to UCListAllProducts in the first tutorial. Now I can connect to an Oracle database and receive all my records(ie. products; in my scenario team group names). Now my Collection variable gets populated with the information using the following syntax. Collection allTeamCodes = broker.getCollectionByQuery(query); All good up to this point; So now I go into the while loop and try to extract the information java.util.Iterator iter = allTeamCodes.iterator(); while (iter.hasNext()) { System.out.println(iter.next()); } And this is what happens: The list of available team groups java.sql.SQLException: ORA-00911: invalid character at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289) at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)[ojb.broker.acc esslayer.JdbcAccess] ERROR: SQLException during the execution of materializeObject: ORA-00911: invalid character ORA-00911: invalid character at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:830) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java :2672) at oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(Oracle PreparedStatement.java:3989) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState ment.java:623) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatem ent.java:527) at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:349) at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl. java:1086) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro kerImpl.java:1204) at ojb.broker.accesslayer.IndirectionHandler.materializeSubject(IndirectionHand ler.java:202) at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(IndirectionHandler. java:187) at ojb.broker.accesslayer.IndirectionHandler.invoke(IndirectionHandler.java:159 ) at $Proxy0.toString(Unknown Source) at java.lang.String.valueOf(String.java:1947) at java.io.PrintStream.print(PrintStream.java:426) at java.io.PrintStream.println(PrintStream.java:563) at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:23) at survey.Application.run(Application.java:34) at survey.Application.main(Application.java:27) ojb.broker.PersistenceBrokerSQLException at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:372) at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl. java:1086)[DEFAULT] ERROR: null at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro kerImpl.java:1204) at ojb.broker.accesslayer.IndirectionHandler.materializeSubject(IndirectionHand ler.java:202) at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(IndirectionHandler. java:187) at ojb.broker.accesslayer.IndirectionHandler.invoke(IndirectionHandler.java:159 ) at $Proxy0.toString(Unknown Source) at java.lang.String.valueOf(String.java:1947) at java.io.PrintStream.print(PrintStream.java:426) at java.io.PrintStream.println(PrintStream.java:563) at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:23) at survey.Application.run(Application.java:34) at survey.Application.main(Application.java:27) ojb.broker.PersistenceBrokerSQLException at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:372) at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl. java:1086) at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro kerImpl.java:1204) at ojb.broker.accesslayer.IndirectionHandler.materializeSubject(IndirectionHand ler.java:202) at ojb.broker.accesslayer.IndirectionHandler.getRealSubject(IndirectionHandler. java:187) at ojb.broker.accesslayer.IndirectionHandler.invoke(IndirectionHandler.java:159 ) at $Proxy0.toString(Unknown Source) at java.lang.String.valueOf(String.java:1947) at java.io.PrintStream.print(PrintStream.java:426) at java.io.PrintStream.println(PrintStream.java:563) at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:23) at survey.Application.run(Application.java:34) at survey.Application.main(Application.java:27) Now since I couldn't get out the information this why I try casting to my TeamGroup class the iterator but this is what happens; The list of available team groups java.lang.ClassCastException: $Proxy0 at survey.UCListAllTeamGroups.apply(UCListAllTeamGroups.java:24) at survey.Application.run(Application.java:34) at survey.Application.main(Application.java:27) So what's is the proxy that I need to use to cast my data? Attached with this email is the source code that I am using. If you could shed an light on this problem; this would be greatly appreciated! Thank you <<OJB.properties>> <<repository.xml>> <<repository_internal.xml>> <<repository_user.xml>> <<AbstractUseCase.java>> <<Application.java>> <<TeamGroup.java>> <<UCListAllTeamGroups.java>> <<UseCase.java>> ____________________________________________________ Peter Warmuz CPSE - PC Developer Java/EJB/JSP/Unix/C++ pet...@ci... 750 Lawrence Avenue West P: (416) 784-2355 East Building 3rd floor F: (416) 784-7712 Toronto, ON M68 1B8 |
From: Andrew G. <Gee...@do...> - 2002-06-15 15:23:17
|
Thanks for your help. I'm new at this, so the problem is probably that I'm not specifying the repository.xml file correctly. I've included my simple test case below along with a short analysis of what the problem seems to be. Thanks Andrew ============================= Here's my very simple test case. table ------ create table test ( id integer not null primary key, desc varchar(25), name varchar(25) ); classes --------- class Test1 { private int id; private String desc; private Test2 test; ... } class Test2 { private int id; private String name; ... } mappings ------------ <class-descriptor class="Test1" table="test" > <field-descriptor id="1" name="id" column="id" jdbc-type="INTEGER" primarykey="true" /> <field-descriptor id="2" name="desc" column="desc" jdbc-type="VARCHAR" /> <reference-descriptor name="test2" class-ref="Test2" auto-retrieve="true" auto-update="true" auto-delete="true" element-class-ref="Test2" > <foreignkey field-id-ref="1"/> </reference-descriptor> </class-descriptor> <class-descriptor class="Test2" table="test" > <field-descriptor id="1" name="id" column="id" jdbc-type="INTEGER" primarykey="true" /> <field-descriptor id="2" name="name" column="name" jdbc-type="VARCHAR" /> </class-descriptor> main method ---------------- Test1 test1 = new Test1(); test1.setId(1); test1.setDesc("Test1"); Test2 test2 = new Test2(); test2.setId(1); test2.setName("Test2"); test1.setTest2(test2); broker.beginTransaction( ); broker.store( test1 ); broker.commitTransaction( ); Looking at the logging output, the following seems to be happening: (1) a select statement is executed to check whether the Test2 mapping exists in the database [it does not] (2) a select statement is executed to check whether the Test1 mapping exists in the database [it does not] (3) an insert statement is executed to map the Test2 values into the database -- success: a row now exists in the database with an id for object Test2 (and since it is the same table object Test1). (4) an *insert* statement is executed to map the Test1 values into the database -- failure because a row already exists with the id for Test1. The problem is that step (4) should be a *modify* and not an insert. I haven't looked at the code yet, but it seems that if step (2) happened after step (3), it would be determined that step (4) should be a modify and the problem would be resolved. For example, if the row already exists in the database and the code is executed, no problem arises because step (4) [and step (3)] is a modify. -----Original Message----- From: Matthew baird [mailto:mat...@ya...] Sent: Friday, June 14, 2002 5:54 PM To: Andrew Geery; 'obj...@li...' Subject: Re: [ojb-users] mapping multiple objects transparently to a single table I don't have the answer offhand (I'm probably the most responsible for multiple objects mapped to a single table right now), but I'll get around to writing a test case for it soon, unless of course you want to write one for me. Once the test case is done, I'll look at fixing it. I'll fix it faster if I have the test case done sooner... hint hint. m Andrew Geery <Gee...@do...> wrote: I was wondering if it is possible to map multiple objects to a single table transparently. For example: Object A maps to table T. Object B contains a reference to object A and also maps to table T. How can I set up the repository.xml file so that when I call broker.store( B ); object A is also stored? The problem I am running into is that the database complains that the id column is specfied more than once in the INSERT statement Can this even be done? If it can, a short example would be wonderful. Thanks Andrew _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users _____ Do You Yahoo!? Sign-up <http://rd.yahoo.com/welcome/*http://fifaworldcup.yahoo.com/fc/en/spl> for Video Highlights of 2002 FIFA World Cup |
From: Matthew b. <mat...@ya...> - 2002-06-14 21:54:11
|
I don't have the answer offhand (I'm probably the most responsible for multiple objects mapped to a single table right now), but I'll get around to writing a test case for it soon, unless of course you want to write one for me. Once the test case is done, I'll look at fixing it. I'll fix it faster if I have the test case done sooner... hint hint. m Andrew Geery <Gee...@do...> wrote: I was wondering if it is possible to map multiple objects to a single table transparently. For example: Object A maps to table T. Object B contains a reference to object A and also maps to table T. How can I set up the repository.xml file so that when I call broker.store( B ); object A is also stored? The problem I am running into is that the database complains that the id column is specfied more than once in the INSERT statement Can this even be done? If it can, a short example would be wonderful. Thanks Andrew _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Objectbridge-users mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-users --------------------------------- Do You Yahoo!? Sign-up for Video Highlights of 2002 FIFA World Cup |
From: Andrew G. <Gee...@do...> - 2002-06-14 21:17:23
|
I was wondering if it is possible to map multiple objects to a single table transparently. For example: Object A maps to table T. Object B contains a reference to object A and also maps to table T. How can I set up the repository.xml file so that when I call broker.store( B ); object A is also stored? The problem I am running into is that the database complains that the id column is specfied more than once in the INSERT statement Can this even be done? If it can, a short example would be wonderful. Thanks Andrew |
From: Grim S. <gri...@ya...> - 2002-06-14 20:17:32
|
Thanks for the rapid patch... OJB is now generating SQL, however the last insert is: INSERT INTO ACCOUNT_ROLE (ACCOUNT_OID,ROLE_OID) VALUES ( 0,1,0 ) I'm no sure what the third 0 is for... While the Account<->Role is M-N, the Person->Account is 1-N, but the Person OID shouldn't be part of the mapping between Account<->Role. Do I need a third field for the PERSON_OID? or is my code messed up somehow? repository_user.xml is attached... ===== Grim Shieldsson (James A Barrows) Acting Chieftain of Clan StormWolf Barbarian Freehold Alliance "The real destroyer of the liberties of the people is he who spreads among them bounties, donations and benefits." --Plutarch __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com |
From: Lorenzo N. <ln...@we...> - 2002-06-14 10:37:33
|
> Date: Thu, 13 Jun 2002 19:57:22 +0200 > From: Thomas Mahler <tho...@ho...> > To: Stephan Merker <Ste...@ce...> > Cc: obj...@li... > Subject: Re: [ojb-users] Long Transactions > > Hi Stephan, > I'm not sure about your application scenario. Please give some more > detail on what you want to do! > > Stephan Merker wrote: > > can anybody give me a hint what'ts the right way to perform long > > transactions using OJB with the ODMG API? > > - Client requests an object by sending a request to the server > > - server performs OQL query = 1st transaction > > - object is send to client > 2nd tx must be opened and unmodified object must be locked in WRITE mode > here! > > - client modifies object > > - client sends object back to server > > - server performs update = 2nd transaction > The object must be locked *before* the client can perform modifications! > It's no problem to hold long ODMG transaction, as they do not consume DB > resources (OJB provides a db independent tx isolation mechanism)! I've the same type of question in a specific scenario. A Servlet application (using Tomcat, no EJB infrastructure). Using ODMG. 1) In a client request I retrieve a persistent object using a transaction (opened and immediately closed). This object is put in the user session context. 2) Later (maybe never) in another client request I get the object from session, open a transaction, lock the object, modify it and commit transaction. I'm not sure that this method will not cause problem of concurrent object modification if, for example, another user retrieve the original persistent object between step 1 an 2. In this scenario, Is it mandatory (or advisable)to always use optimistic locking? To add more elements the the scenario, it is possible to have different Servlet application (different VM) using the same persistent source (using OJB in C/S mode). bye Lorenzo WEBPLAN srl v.Civerchio 4 20159 MILANO - ITALY tel. +39-02-69311782 fax. +39-02-60857392 |
From: Thomas M. <tho...@ho...> - 2002-06-13 17:57:27
|
Hi Stephan, I'm not sure about your application scenario. Please give some more detail on what you want to do! Stephan Merker wrote: > Hello, > > can anybody give me a hint what'ts the right way to perform long > transactions using OJB with the ODMG API? > > E.g. > > - Client requests an object by sending a request to the server > - server performs OQL query = 1st transaction > - object is send to client 2nd tx must be opened and unmodified object must be locked in WRITE mode here! > - client modifies object > - client sends object back to server > - server performs update = 2nd transaction > > How-to perform the update? I tried Transaction.lock(obj, Transaction.WRITE) > but then the object is not written because the dirty check is performed > against the object passed to the lock() method and not against the state of > the persistent object (in the database or cache). > The object must be locked *before* the client can perform modifications! It's no problem to hold long ODMG transaction, as they do not consume DB resources (OJB provides a db independent tx isolation mechanism)! cheers, Thomas > Any ideas? > > Thanks, > Stephan > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > |
From: Thomas M. <tho...@ho...> - 2002-06-13 17:42:07
|
Hi Christoph, Christoph Sturm wrote: > Hi ojb team! > > I am converting a project to use ojb, and i wonder if i'd better use the > persistence broker or odmg. Reading the faq i came to the conclusion > that odmg is always better because it supports more features. Here is a rule of thumb: if you build little demo applications PB is very nice to use. Using PB is also very useful in batch programming (mass operations) if you want to build "real" (multi-user, multi-transaction)-apps the ODMG layer is much better. > But then i > read a posting on theserverside.com which says that the persistence > broker performance is (much?) better than the odmg api. If you look a mass-operation performance using the PB is much faster. If you want to build typical web-apps with many users but short transaction, ODMG is OK! > Some neat features like querybyexample seem to be available only in the > PB. Or is there a way to access the broker from the odmg side of ojb? > You can safely mix PB and ODMG API! So it's pretty OK to load Objects with a ojb.broker.query.Query and use them within an ODMG transaction. Have a look at ojb.odmg.oql.OqlQueryImpl.execute() how this is done! hope you'll enjoy OJB, Thomas > Tia > chris > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Objectbridge-users mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-users > > > |
From: Stephan M. <Ste...@ce...> - 2002-06-13 16:32:43
|
Hello, can anybody give me a hint what'ts the right way to perform long transactions using OJB with the ODMG API? E.g. - Client requests an object by sending a request to the server - server performs OQL query = 1st transaction - object is send to client - client modifies object - client sends object back to server - server performs update = 2nd transaction How-to perform the update? I tried Transaction.lock(obj, Transaction.WRITE) but then the object is not written because the dirty check is performed against the object passed to the lock() method and not against the state of the persistent object (in the database or cache). Any ideas? Thanks, Stephan |
From: Mahler T. <tho...@it...> - 2002-06-13 15:42:12
|
=20 -----Urspr=FCngliche Nachricht----- Von: Srividya Vullanki [mailto:p_s...@ya...] Gesendet: Donnerstag, 13. Juni 2002 17:38 An: Mahler Thomas Betreff: Re: AW: AW: [Fwd: Thank you] Hi Thomas,=20 The OJB tool worked great on Win2K using MySQL as the database. But, = when we tried to implement on Tandem box using NonStop SQL as the Database, = we had a couple of problems. We are not sure what the problem is though.=20 Probably you could help us out, so that we could succefully implement = on Tandem.=20 Below, Is the attached error message. If you could explain to us what = SQL statements are passed to JDBC, it could help us to track down whether = its a problem with the JDBC driver on Tandem.=20 Once again Thnaks a bunch.=20 FYI, We added a some print statements for debugging purposes.=20 Sri=20 /usr/tandem/objectpersistence>java TandemTester Persisting an ATRDataContainer Object [BOOT] INFO: OJB.properties: file:/usr/tandem/objectpersistence/OJB.properties [DEFAULT] INFO: OJB Descriptor Repository: file:/usr/tandem/objectpersistence/re pository.xml [BOOT] INFO: loading XML took 1080 msecs [DEFAULT] INFO: ...Finished parsing Created an instance of ATREStaticData Got the Static Data [ojb.broker.singlevm.PersistenceBrokerImpl] DEBUG: store com.co.atre.engine.cont ainer.ATRDataContainer@90132bee = <mailto:ainer.ATRDataContainer@90132bee>=20 [ojb.broker.singlevm.PersistenceBrokerImpl] DEBUG: getObjectByIdentity ojb.broke r.util.sequence.HighLowSequence{com.co.atre.engine.container.ATRDataCont= aine r,m_ intPnrID} [ojb.broker.accesslayer.SqlGenerator] DEBUG: SQL: SELECT A0.CLASSNAME,A0.FIELDNA ME,A0.MAX_KEY,A0.GRAB_SIZE FROM =3DOJB_HL_SEQ A0 WHERE (A0.CLASSNAME = =3D ?) AND (A0. FIELDNAME =3D ?) [ojb.broker.accesslayer! .StatementsForClass] DEBUG: prepareStatement: SELECT A0.C LASSNAME,A0.FIELDNAME,A0.MAX_KEY,A0.GRAB_SIZE FROM =3DOJB_HL_SEQ A0 = WHERE (A0.CLAS SNAME =3D ?) AND (A0.FIELDNAME =3D ?) [ojb.broker.accesslayer.JdbcAccess] DEBUG: before bind select.... Number of primary Keys...2 First Value is com.co.atre.engine.container.ATRDataContainer Value is not null.. and setting the object with values Arg 1 01 arg 2 com.co.atre.engine.container.ATRDataContainer arg 3 12 First Value is m_intPnrID Value is not null.. and setting the object with values Arg 1 11 arg 2 m_intPnrID arg 3 12 [ojb.broker.accesslayer.JdbcAccess] DEBUG: After bind select.... [ojb.broker.accesslayer.JdbcAccess] DEBUG: After EXCUTING QUERYD***************=20 [ojb.broker.singlevm.PersistenceBrokerImpl] DEBUG: store ojb.broker.util.sequenc e.HighLowSequence@e9e32beb <mailto:e.HighLowSequence@e9e32beb>=20 [ojb.broker.accesslayer.JdbcAccess] DEBUG: before bind select.... Number of primary Keys...2 First Value is com.co.atre.engine.container.ATRDataContainer Value is not null.. and setting the object with values Arg 1 01 arg 2 com.co.atre.engine.container.ATRDataContainer arg 3 12 [DEFAULT] ERROR: bindSelect failed for: ojb.broker.util.sequence.HighLowSequence {com.co.atre.engine.container.ATRDataContainer,m_intPnrID}, PK: 0, = value: com.co .atre.engine.container.ATRDataContainer [ojb.broker.accesslayer.JdbcAccess] ERROR: SQLException during the = execution of materializeObject: SQLMP: Cannot set a value in a statement with an = open cursor SQLMP: Cannot set a value in a statement with an open cursor java.sql.SQLException: SQLMP: Cannot set a value in a! statement with = an open cu rsor at com.tandem.sqlmp.SQLMPPreparedStatement.setObject(SQLMPPreparedStatem ent.java, Compiled Code) at com.tandem.sqlmp.SQLMPPreparedStatement.setObject(SQLMPPreparedStatem ent.java, Compiled Code) at ojb.broker.accesslayer.StatementManager.bindSelect(Unknown Source) at ojb.broker.accesslayer.JdbcAccess.materializeObject(Unknown Source) at ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown = Source) at ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueId(Unkno wn Source) at ojb.broker.util.sequence.SequenceManagerDefaultImpl.getUniqueLong(Unk nown Source) ! at = ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueLong(Unkn own Sourc e) at ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown Source) at ojb.broker.util.sequence.SequenceManagerHighLowImpl.getUniqueId(Unkno wn Source) at ojb.broker.util.sequence.SequenceManagerDefaultImpl.getUniqueLong(Unk nown Source) at = ojb.broker.singlevm.PersistenceBrokerImpl.getUniqueLong(Unknown Sourc e) at = ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(Unknown Sou rce) at ojb.broker.metadata.ClassDescriptor.getKeyValues(Unknown = Source) at ojb.broker.Identity.<init>(Unknown Source) at ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown = Source) at object! = persistence.ATRObjectPersistor.writeATREObject(Unknown Source) at TandemTester.main(TandemTester.java, Compiled Code) [DEFAULT] ERROR: OJB ERROR: Dont know how to autoincrement field class com.co.at re.engine.container.ATRDataContainer.m_intPnrID java.lang.RuntimeException: OJB ERROR: Dont know how to autoincrement = field clas s com.co.atre.engine.container.ATRDataContainer.m_intPnrID at = ojb.broker.metadata.ClassDescriptor.getAutoIncrementValue(Unknown Sou rce) at ojb.broker.metadata.ClassDescriptor.getKeyValues(Unknown = Source) at ojb.broker.Identity.<init>(Unknown Source) at ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown = Source) at objectpersistence.ATRObjectPersistor.write! = ATREObject(Unknown Source) &nbs p; at TandemTester.main(TandemTester.java, Compiled Code) [DEFAULT] ERROR: null ojb.broker.PersistenceBrokerException at ojb.broker.metadata.ClassDescriptor.getKeyValues(Unknown = Source) at ojb.broker.Identity.<init>(Unknown Source) at ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown = Source) at objectpersistence.ATRObjectPersistor.writeATREObject(Unknown Source) at TandemTester.main(TandemTester.java, Compiled Code) [ojb.broker.singlevm.PersistenceBrokerImpl] ERROR: Error in Transaction abort: S QLMP: Cannot rollback in auto commit mode null ojb.broker.metadata.ClassNotPersistenceCapableException at ojb.broker.singlevm.PersistenceBrokerImpl.store(Unknown = Source) &nb! sp; at objectpersistence.ATRObjectPersistor.writeATREObject(Unknown Source) at TandemTester.main(TandemTester.java, Compiled Code) Writing into the database!!!! =20 _____ =20 Do You Yahoo!? Sign-up <http://rd.yahoo.com/welcome/*http://fifaworldcup.yahoo.com/fc/en/spl> = for Video Highlights of 2002 FIFA World Cup |