Re: PB and Oracle9i: transaction issue
On Aug 10, 2005, at 4:02 PM, Thomas Dudziak wrote: Thank you to my previous employer (Fort Hill Company) for allowing me to distribute this. I'll clean it up and put it in CVS for 1.0.4 when It takes a PBKey and verifies that the metadata is sane for the actual database schema (examined via JDBC metadata). WDYT, does it make sense to rework this to use the DdlUtils API and make a Ant task from it ? We could, but I think it works better as a JUnit TestCase. It can be integrated right in with system tests, run from ant, etc, right now. Understanding DdlUtils schemas would also be good, but I think that would be a separate test case =) -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PB and Oracle9i: transaction issue
On Aug 10, 2005, at 11:22 AM, Guillaume Laforge wrote: What a pity the messages are so misleading... I guess some sanity checker is in order so that we can compare a mapping and a database's schema (hint, hint Brian!). Okay =) Thank you to my previous employer (Fort Hill Company) for allowing me to distribute this. I'll clean it up and put it in CVS for 1.0.4 when I get a chance, meanwhile (as the first email isn't making it through the list, probably the attachment)... http://morphy.skife.org/TestOJBSchemaSanity.java It takes a PBKey and verifies that the metadata is sane for the actual database schema (examined via JDBC metadata). -Brian
Re: PB and Oracle9i: transaction issue
On Aug 10, 2005, at 11:22 AM, Guillaume Laforge wrote:What a pity the messages are so misleading... I guess some sanity checker is in order so that we can compare a mapping and a database's schema (hint, hint Brian!). Okay, attached =)Thank you to my previous employer (Fort Hill Company) for letting me distribute this!-Brian TestOJBSchemaSanity.java Description: Binary data
Re: PB and Oracle9i: transaction issue
Mapping is biggest weakness in o/r mapping right now =( Most issues come down to "not quite correct" mapping all too often =( On Aug 10, 2005, at 11:22 AM, Guillaume Laforge wrote: Hi again, I hesitate to reveal the truth and expose how stupid I must be... but still... I think I've found the source of my problem. It seems as if it were a mere mapping issue! What a pity the messages are so misleading... I guess some sanity checker is in order so that we can compare a mapping and a database's schema (hint, hint Brian!). In my mapping, it seems like I had configured a many-to-many relationship, though what I really had was a simple one-to-many relationship: I had a foreignkey AND remote-foreignkey in my xdoclet tags pointing at the same column. Though obviously the remote-foreignkey wasn't needed at all. Then, I set back autocommit to 2 explicitely (to be sure I was in autocommit false), and tried again my little test... and... tada... all my objects were rollbacked as I expected! I'm sad I wasted that many hours on such a trivial problem :-( I apologize for having bothered you with somewhat of a false problem :-( Anyway, thanks a lot for your great support and help. -- Guillaume Laforge http://glaforge.free.fr/blog/groovy - 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: Where to find OJB 1.1
Apache, not SourceForge. Otherwise yes, HEAD/trunk is what will be 1.1. -Brian On Aug 3, 2005, at 3:00 PM, Hale India wrote: Hi Brian Do you mean that in sourceforge CVS db-ojb it is 1.1 source code ? Best regards Andre --- Brian McCallister <[EMAIL PROTECTED]> wrote: OJB 1.1 has not been released. Are you sure you didn't have 1.0.1? The other possibility is that someone built your jar from cvs at some point based on the upcoming 1.1. -Brian On Aug 3, 2005, at 1:19 PM, Hale India wrote: Hi I am using OJB for our project. I got during may db-ojb-1.1.0.jar etc. I was looking to get up to date OJB 1.1 elements and I don't find them again. Idon't find any 1.1 jar nor 1.1 CVS. Can you help me? Andre Legendre - 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: Where to find OJB 1.1
OJB 1.1 has not been released. Are you sure you didn't have 1.0.1? The other possibility is that someone built your jar from cvs at some point based on the upcoming 1.1. -Brian On Aug 3, 2005, at 1:19 PM, Hale India wrote: Hi I am using OJB for our project. I got during may db-ojb-1.1.0.jar etc. I was looking to get up to date OJB 1.1 elements and I don't find them again. Idon't find any 1.1 jar nor 1.1 CVS. Can you help me? Andre Legendre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.1
Answered in the -dev list =) -Brian On Jun 22, 2005, at 2:49 AM, Cosmin MERLUSCA wrote: Hello, I'm using OJB and I would have a number of questions for you: 1. Is this project going on or is it going to be stopped? The answer to this is critical for the project. 2. If is going to continue, when is OJB 1.1 due to come out? 3. Will OJB 1.1 solve the problem of complex expressions? I have spent quite a lot of time searching the answer to this question, and I have seen that there was some work done on 1.0.3, but this is hardly enough. What I need is to be able to create complex expressions and if this problem is not going to be solved, I can perform SQL queries directly. I just want to know, so that I can make a planning on my work and on the directions on which I should go. Thank you and I hope for a very quick answer, Cosmin MERLUSCA. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB, JDO2 and apache jdo project (and jpox)
On Jun 2, 2005, at 12:12 PM, Martin Taal wrote: Hi, I have a question, what is the future of jdo support in ojb in relation to the jdo2 spec and the apache jdo project (http:// wiki.apache.org/jdo/)? In a post (20 March 2005) to this mailing list from Brian McCallister he says the following: >> OJB's JDO implementation is more proof-of-concept than production- usable. A good open source JDO implementation is JPOX ( http:// www.jpox.org/ ). Before long there should be an Apache JDO ( http:// wiki.apache.org/jdo/ )project which can use OJB as the O/R Mapping backend. << Brian says that apache jdo can use ojb as the backend. Is this indeed the current idea of the apache jdo project and if so what timeframe should I think of? The Apache JDO project ( [EMAIL PROTECTED] ) is going. The priority, right now, is finishing the JDO 2.0 TCK rather than the implementation (which will need to wait until final JDO 2.0 spec (close) and the TCK to be completed (to verify that it passes!)). The JDO 1.0.X RI codebase has been imported to the ASF subversion repository, and we could build up the OJB - JDO 1.0 plugin to be beefier, except that I think the general concensus is that JDO 2.0 is so much better than 1.0 that we may as well just build towards that. I still recommend JPOX if you need an open source JDO implementation (though I've not had a chance to use the now open-sourced Versant one, it may be very nice, I dunno). JPOX doesn't provide the range of databases, or all of the flexibility of OJB, but it does do a compliant JDO =) -Brian Thanks for any clarifications on this. -- With Regards, Martin Taal Springsite Barchman Wuytierslaan 72b 3818 LK Amersfoort tel: +31 (0)33 462 02 07 fax: +31 (0)33 463 77 12 Mobile: +31 (0)6 288 48 943 email: [EMAIL PROTECTED] web: www.springsite.com - 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: Help Getting Started
The getting started page is probably the most useful. http://db.apache.org/ojb/docu/getting-started.html -Brian On Apr 11, 2005, at 9:55 AM, Scott Purcell wrote: Hello, I would like to try and get started using the OJB product. I am on the website, but do not see where to begin. So I downloaded this: db-ojb-1.0.3-bin.zip and extracted it, hoping for some simple webapp example. Back at the website I tried following the ODGM Tutorial. But it goes nowhere. I created the Products.java class, and then went to the mappings (incomplete) link. And ended up with no information. Kind of a cluster of deadends. I would like to create a couple of simple tables, a could of simple classes, and see how this works. Can anyone give me a link, or post some examples of tying this together? Maybe I am going down the wrong isle. Thanks, Scott K Purcell | Developer | VERTIS | 555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com Vertis is the premier provider of targeted advertising, media, and marketing services that drive consumers to marketers more effectively. - 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]
Apache OJB 1.0.3 Released
Apache Object/Relational Bridge (OJB) is an Object/Relational mapping tool that allows transparent persistence for Java objects against relational databases. The OJB team is happy to announce the 1.0.3 release: - Release 1.0.3 - NEW FEATURES: NOTES: - odmg-api: Named objects can now be non- and persistence capable objects. At least the named object have to be serializable. CHANGES: - Refactoring DCollection implementations, remove DListImpl_2 classes (code moved to DListImpl) - Object2ByteArrFieldConversion: If source object on conversion javaToSQL is 'null', no longer create an byte array simply return 'null' BUG FIXES: Please refer to our Bug tracking site (http://issues.apache.org/jira/secure/BrowseProject.jspa?id=10700) to see details for a bug with id OJB-xxx. - odmg-api: OJB-7 - Fix critical property setting in OJB.properties file - odmg-api: OJB-8 - Fix bug when using cascading delete on empty 1:1 reference - odmg-api: Fix bug with named object. On 'unbind' of a named object, if the object is a persistence capable object (object with metadata mapping), the object itself will not be deleted. All other (serializable) named objects will be deleted on unbind. - odmg-api: Fix bug with named objects when using database based Identity columns (SequenceManagerNativeImpl) - odmg-api: Fix bug when persisting DCollection instances when using database based Identity columns (SequenceManagerNativeImpl). KNOWN ISSUES: - Auto-Detection for insert/update objects checks to avoid DB queries the PK fields of the object. If at least one PK field is 'NULL' or if primitive field '0', OJB assume the object is new and needs insert. This will be configurable in next upcoming version. Workaround for PB-api: use method PB#store(Object obj, ObjectModification mod) to state update or insert. - Batch handling doesn't work proper with optimistic locking. This will be fixed in version 1.1 - Subqueries are not extent aware. see QueryTest#testSubQueryAgainstExtents - When a class mapped on multiple joined tables was used in a reference only objects of the base type class will be instantiated, e.g. a Company class has a 1:n reference 'employees' to a base class Employee and class Manager extends Employee, then 'employees' only contains objects of type Employee even if the real type was Manager. See in OJB test suite ...broker.InheritanceMultipleTableTest#testInheritancedObjectsInCollecti onReferences Same problem occur when query the base class, then OJB only returns objects of base type instead the real type. - Managed Environment: When run OJB in managed environment and using PBStateListener, the call of PBStateListener#beforeClose(PBStateEvent event) is made twice when a PB instance was closed in a JTA-tx (for the first time when PB.close() was called in bean on the PB handle, second time when the JTA-tx completes) - otm-api: The OTM API has a known caching issue and should not be considered for code used in production environments. The future of the OTM layer will be subject for discussion on the OJB developers list, if you are using it - please subscribe to ojb-dev and make your voice heard. - Oracle9i platform: when using statement batching, there is a 2k limit on BLOB + 4k limit on CLOB. - Release 1.0.2 - NEW FEATURES: - New ant-target ojb-quickstart creates archives of ready-to-run apps for tutorials 1 and 2 complete with pre-created Hsqldb databases (based on ojb-blank). These archives are also available in the binary download area. - Introduce first version of a two-level cache (transactional session cache with an application cache handle with copies of cached objects). More detailed information see 'object cache' reference guide in docs. - All Oracle platforms will now transparently handle java.lang.Character fields mapped to jdbc-types CHAR or VARCHAR, without any conversion class. - Oracle9i plaform now handles CLOB>4k and BLOB>2k when DBCP and/or P6Spy are used. - Oracle9i plaform can now be used with Oracle10g JDBC-driver. Escape processing statements are removed and OracleConnection unwrapping have been adjusted to be compatible with 10g JDBC. - XDoclet module: * Important: generate-table-info now only prevents the generation of a table in the database schema, the class-descriptor is unaffacted * The new ojb.class#generate-repository-info attribute prevents the generation of field/reference/collection descriptors in the repository as well as the table in the database schema This attribute should be used when using inheritance with interfaces/abstract classes * Database foreignkeys are now
Re: 1.0.3 Release
Already did! -Brian On Apr 5, 2005, at 11:36 AM, Armin Waibel wrote: Hi Brain, Brian McCallister wrote: Tagged ( OJB_1_0_3 ) and pushed 1.0.3 just now. Will post an announcement for 1.0.3 (with the note about the unannounced 1.0.2) tomorrow after things mirror out. Seems that all mirror's are up-to-date. Is there are reason *not* to post the 1.0.3 announcement? regards, Armin If you have access to minotaur you can grab it, otherwise it should be available from db.apache.org in < 4 hours. Big kudos to Armin for this one! -Brian - 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]
1.0.3 Release
Tagged ( OJB_1_0_3 ) and pushed 1.0.3 just now. Will post an announcement for 1.0.3 (with the note about the unannounced 1.0.2) tomorrow after things mirror out. If you have access to minotaur you can grab it, otherwise it should be available from db.apache.org in < 4 hours. Big kudos to Armin for this one! -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: status on 1.02 release?
Am pushing it tonight. Won't announce until tomorrow night though so that it can mirror out first =) -Brian On Mar 24, 2005, at 12:08 PM, Ryan Vanderwerf wrote: Just checking if anyone knows the target date for 1.02? I am looking to upgrade but am afraid of the cache problem in 1.01. Ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDO && OJB
JDO Central ( http://www.jdocentral.com/ ) is a good JDO starting point. The best source for info on JDOQL is the spec, it is actually pretty clear, I think ( http://jcp.org/aboutJava/communityprocess/pr/jsr243/index2.html ). OJB's JDO implementation is more proof-of-concept than production-usable. A good open source JDO implementation is JPOX ( http://www.jpox.org/ ). Before long there should be an Apache JDO ( http://wiki.apache.org/jdo/ )project which can use OJB as the O/R Mapping backend. -Brian On Mar 19, 2005, at 7:09 PM, Markus Wolf wrote: Are there any advanced tutorials for JDOQL available? Or has someone some links to good resources about JDOQL? Regards Markus Wolf -- emedia-solutions wolf Wedeler Landstrasse 63 22559 Hamburg (040) 550 083 70 web: http://www.emedia-solutions-wolf.de mail: [EMAIL PROTECTED] pgp: http://wwwkeys.de.pgp.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Persistent Broker cache impl with ODMG tx
No worries =-) -Brian On Feb 1, 2005, at 9:33 AM, Łukasz Korzybski wrote: Dnia wtorek, 1 lutego 2005 12:40, Łukasz Korzybski napisał: My mistake sorry, repository_database.xml has overriden settings in OJB.properties. Once more sorry for spamming :) Łukasz Korzybski - 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: where to get jdo.jar
It looks like you don't have junit in your ant classpath. JUnit, unfortunately, must be in ant's global classpath for arcane reasons I don't personally fully understand =( Short form is that you need to copy the junit jar file to $ANT_HOME\lib\ or $HOME\.ant\lib in order to use junit from ant. -Brian On Jan 4, 2005, at 8:29 AM, Ashish Srivastava wrote: Hi, I have downloaded source (db-ojb-1.0.1-src.zip) -> unzipped in a folder (D:\Data\Ashish\OpenSourceProjects) -> run command "ant junit" I am running OpenCMS test with default setting. I ended up with Build Failed. Where I am wrong please let me know. Regards, Ashish Srivastava . .. [javac] D:\Data\Ashish\OpenSourceProjects\db-ojb -1.0.1\target\srctest\org\apache\ojb\otm\MtoNTest.java:123: warning: setCascadeStore(boolean) in org.apache.ojb.broker.metadata.ObjectReferenceDescri ptor has been deprecated [javac] cod.setCascadeStore(autoUpdate); [javac]^ [javac] D:\Data\Ashish\OpenSourceProjects\db-ojb -1.0.1\target\srctest\org\apache\ojb\otm\MtoNTest.java:131: warning: getCascadeStore() in org.apache.ojb.broker.metadata.ObjectReferenceDescriptor ha s been deprecated [javac] boolean autoUpdate = cod.getCascadeStore(); [javac] ^ [javac] D:\Data\Ashish\OpenSourceProjects\db-ojb -1.0.1\target\srctest\org\apache\ojb\otm\MtoNTest.java:133: warning: setCascadeStore(boolean) in org.apache.ojb.broker.metadata.ObjectReferenceDescri ptor has been deprecated [javac] cod.setCascadeStore(true); [javac]^ [javac] D:\Data\Ashish\OpenSourceProjects\db-ojb -1.0.1\target\srctest\org\apache\ojb\otm\MtoNTest.java:159: warning: setCascadeStore(boolean) in org.apache.ojb.broker.metadata.ObjectReferenceDescri ptor has been deprecated [javac] cod.setCascadeStore(autoUpdate); [javac]^ [javac] 35 warnings [javac] Compiling 85 source files to D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\target\classestools checkP6Spy: useP6Spy: dontUseP6Spy: [echo] NOT using P6Spy to trace JDBC calls. prepare-repository: [copy] Copying 26 files to D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\target\test\ojb [copy] Copying 1 file to D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\target\test [copy] Copying 1 file to D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\target\test prepare-testdb: [copy] Copying 4 files to D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\target\test initJNETSQLServer: getJSQLDriver: check-use-classpath: check-run-only-on-schema-change: sql-check: sql: [echo] +--+ [echo] | | [echo] | Generating SQL for YOUR Torque project! | [echo] | Woo hoo! | [echo] | | [echo] +--+ sql-classpath: [torque-sql] Using contextProperties file: D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\build.properties [torque-sql] Using classpath [torque-sql] Generating to file D:\Data\Ashish\OpenSourceProjects\db-ojb -1.0.1\target\test\sql\report.ojbtest.sql.generation [torque-sql] Parsing file: 'ojbcore-schema.xml' [torque-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [torque-sql] Parsing file: 'ojbtest-schema.xml' [torque-sql] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package sql-template: create-db-check: create-db: [torque-data-model] Using classpath [torque-data-model] Generating to file D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\target\test\sql\create- db.sql [torque-data-model] Parsing file: 'ojbcore-schema.xml' [torque-data-model] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [torque-data-model] Parsing file: 'ojbtest-schema.xml' [torque-data-model] (transform.DTDResolver 128 ) Resolver: used database.dtd from org.apache.torque.engine.database.transform package [echo] [echo] Executing the create-db.sql script ... [echo] [sql] Executing file: D:\Data\Ashish\OpenSourceProjects\db-ojb-1.0.1\target\test\sql\create- db.sql [sql] Failed to execute: ECHO Not implemented [sql] java.sql.SQLException: Unexpected token: ECHO in statement [ECHO Not implemented] [sql] 0 of 1 SQL statements executed successfully datasql: [echo] +---+ [echo] | | [echo] | Generating SQL from data XML !| [echo] | Woo hoo! | [echo] |
Re: Advice on using OJB collections and Struts
You don't need to expose the session upwards. A proxied collection in OJB is capable of obtaining a PersistenceBroker if the one used to initial obtain the instance with the collection has been closed. The only possible hangup with this is that the work is done, typically, in a transaction, and if the proxy is de-referenced outside of that transaction there is the possibility of stale data. On the other hand, the the same thing holds true using hibernate with an open session and closed transaction, and if the data wasn't loaded into the proxy during the transaction, it certainly wasn't used as part of it =) -Brian On Dec 20, 2004, at 10:33 AM, Ray wrote: Thanks to everyone who replied. It seems I was thinking that it used the Hibernate approach, which requires exposing the session right up to the presentation layer. I imagine that OJB does the same thing ... only the developer doesn't have to worry about it. Seems I have a bit more reading to do before I make a start on the conversion, but at least it means we can keep much of the database objects the same as they are for Hibernte; we just have to change stuff below the service layer that returns these objects from the database. Great stuff! Can't wait to get started! Any good books on OJB, by the way? --- Brian McCallister <[EMAIL PROTECTED]> wrote: I'll second this one -- the best approach I know is just to use the domain model object as the thing the JSP renders. -Brian On Dec 20, 2004, at 7:36 AM, Edson Carlos Ericksson Richter wrote: I've used the OJB objects and collections directly, since they *are* my VO. There is no need to maintain any kind of "open session", even if you are using proxies (OJB will care about opening a database session to load object on demand)... I never used OJB + EJB, so I can' tell you how this could work in a distributed environment. But with JSP accessing local datasources, I had no problems. Copying object to other objects/collections could lead into unecessary overhead. I expect this helps. Edson Richter Ray escreveu: Hi there ... :-) I'm involved in a small project to convert from a Hibernate backend, to OJB. The presentation tier uses Struts and JSTL to render pages. I was wondering how you OJB handles collections attached to objects, that need to be rendered in the JSP pages. For example, if I have an Order object that contains a collection of OrderLines, and I want to create a page to display the whole order, then what is the bst way to handle this? Is it best to copy the whole Order and OrderLines into some kind of VO, and then send that to the page? Or do you use the Hibernate approach of leaving the session open for the whole request cycle, so that the JSTL on the page, can access the collection directly from the Order object? Hope that makes sense ... :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Edson Carlos Ericksson Richter MGR Informática Ltda. Fones: 3347-0446 / 9259-2993 - 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] __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com - 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: Advice on using OJB collections and Struts
I'll second this one -- the best approach I know is just to use the domain model object as the thing the JSP renders. -Brian On Dec 20, 2004, at 7:36 AM, Edson Carlos Ericksson Richter wrote: I've used the OJB objects and collections directly, since they *are* my VO. There is no need to maintain any kind of "open session", even if you are using proxies (OJB will care about opening a database session to load object on demand)... I never used OJB + EJB, so I can' tell you how this could work in a distributed environment. But with JSP accessing local datasources, I had no problems. Copying object to other objects/collections could lead into unecessary overhead. I expect this helps. Edson Richter Ray escreveu: Hi there ... :-) I'm involved in a small project to convert from a Hibernate backend, to OJB. The presentation tier uses Struts and JSTL to render pages. I was wondering how you OJB handles collections attached to objects, that need to be rendered in the JSP pages. For example, if I have an Order object that contains a collection of OrderLines, and I want to create a page to display the whole order, then what is the bst way to handle this? Is it best to copy the whole Order and OrderLines into some kind of VO, and then send that to the page? Or do you use the Hibernate approach of leaving the session open for the whole request cycle, so that the JSTL on the page, can access the collection directly from the Order object? Hope that makes sense ... :-) __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Edson Carlos Ericksson Richter MGR Informática Ltda. Fones: 3347-0446 / 9259-2993 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB.properties
I actually generally prefer marc: http://marc.theaimsgroup.com/?l=ojb-user&r=1&w=2 the search and navigation tends to be nicer than eyebrowse, imho. -Brian On Dec 16, 2004, at 5:43 AM, Thomas Dudziak wrote: liooil wrote: Hello world, Maybe this topic has already been discussed and i apologize if it's the case. But as previously said, it's still impossible to search through the archiver sites of this mailing list... Mhmm, the eyebrowse archive at http://nagoya.apache.org/eyebrowse/SummarizeList?listName=ojb- [EMAIL PROTECTED] works for me. The thing is i want to deploy OJB inside my webapp war file. And of course, when it starts (call to OJB.getInstance()), the configurations files are searched by default in the directory of the process who launched everything (i.e Jboss) : 10:49:57,890 INFO [STDOUT] Could not load properties file 'OJB.properties'. Using default settings! 10:49:57,890 INFO [STDOUT] XXX\jboss-3.2.2\bin\OJB.properties For deployement convenience, i would like to embbed all OJB configuartion files needed for OJB in my web/WEB_INF. The aim is to avoid to pollute all JBoss tree directory. It also should prevzent from forgeting in conf file when i app will be supplied. know what i mean? If you place the OJB.properties into the WEB-INF/classes directory, then it should be found by OJB as it uses the classpath to find the OJB.properties file. Same goes for repository.xml and related files. 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: REPOST: OJB's support for object migration: [e.g torque table schema- how to alter existing table ]
There aren't many docs. best way to get it is to build from CVS. There are samples and some docs included in the cvs download. Is not a *big* project, and I'd be happy to help you figure out how to use it. Best way to get started is to pull from CVS (is always stable) and look at the samples. If you think of something it needs, I'll prolly be happy to put it in. I use this thing pretty much every day. -Brian On Sep 21, 2004, at 7:13 PM, Ajitesh Das wrote: Brian: I am not able to d'load the project or able to find any docs. Can u send me the pointer? ~ajitesh -Original Message- From: Brian McCallister [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 21, 2004 3:03 PM To: OJB Users List Subject: Re: REPOST: OJB's support for object migration: [e.g torque table schema- how to alter existing table ] OJB doesn't transparently migrate data -- I don't know of any good high-level general purpose tool which can do that. I wrote an incremental data-migration oriented tool a while back, but it doesn't use an o/r mapping. Simple is a dependency resolver with convenience features for database migrations. http://migratosaur.dev.java.net Nothing fancy about it, but it is maintained and works well for me =) No automated schema change discovery and guesswork -- no way to *know* the intention of changes, unfortunately. Any migration requires some human integration. I can imagine a "database refactoring browser" with a drag/click-and-act/etc type thing which encapsulates the actions into a serializable thing to automate this, but to my knowledge no one has written one. -Brian On Sep 21, 2004, at 5:57 PM, Ajitesh Das wrote: Reposting again. Let's see if anybody has any recommendation. -Original Message- Hi List: I like to know if anybody who uses OJB platform in his product has done anything on object model migration. This seems to be a missing piece in OJB project. Am I missing something? Example Scenario: I have an existing application that uses OJB as OR platform contains a set of business objects. In this new release, we are altering the definition of business object by adding new fields for some objects and deleting some fields for others. I would like to know how other users are handling the two situations: (a) When you add a new field to an existing object and (b) when you delete a field in an existing object. So that the old data can be kept and properly defaulted. I have searched the Wiki ,docs and mail archive but could not find any recommendation/reference from the OJB developers/gurus or reference to some design patterns. Regds Ajitesh - 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: REPOST: OJB's support for object migration: [e.g torque table schema- how to alter existing table ]
OJB doesn't transparently migrate data -- I don't know of any good high-level general purpose tool which can do that. I wrote an incremental data-migration oriented tool a while back, but it doesn't use an o/r mapping. Simple is a dependency resolver with convenience features for database migrations. http://migratosaur.dev.java.net Nothing fancy about it, but it is maintained and works well for me =) No automated schema change discovery and guesswork -- no way to *know* the intention of changes, unfortunately. Any migration requires some human integration. I can imagine a "database refactoring browser" with a drag/click-and-act/etc type thing which encapsulates the actions into a serializable thing to automate this, but to my knowledge no one has written one. -Brian On Sep 21, 2004, at 5:57 PM, Ajitesh Das wrote: Reposting again. Let's see if anybody has any recommendation. -Original Message- Hi List: I like to know if anybody who uses OJB platform in his product has done anything on object model migration. This seems to be a missing piece in OJB project. Am I missing something? Example Scenario: I have an existing application that uses OJB as OR platform contains a set of business objects. In this new release, we are altering the definition of business object by adding new fields for some objects and deleting some fields for others. I would like to know how other users are handling the two situations: (a) When you add a new field to an existing object and (b) when you delete a field in an existing object. So that the old data can be kept and properly defaulted. I have searched the Wiki ,docs and mail archive but could not find any recommendation/reference from the OJB developers/gurus or reference to some design patterns. Regds Ajitesh - 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: Build problem with OJB1.0.1 / JDK 1.3
On Sep 15, 2004, at 5:12 AM, Thomas Dudziak wrote: (my guess is that OJB 1.0.1 simply wasn't tested on JDK 1.3 prior to releasing it). I didn't, and I released. Will move discussion to -dev about how to best fix. May be that we should stick with SCSL j2ee 1.3 jars for a while longer =( Ick. -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Build problem with OJB1.0.1 / JDK 1.3
You are correct, it is the j2ee 1.4 jar which breaks it. Sorry about that. We should include docs about building with earlier j2ee versions! We switched to the geronimo-spec jars to remove the build time annoyance of having to go get the jars from Sun. -Brian On Sep 15, 2004, at 4:59 AM, [EMAIL PROTECTED] wrote: Hi, I tried to build the jars with JDK1.3 (1.3.1_12) which failed with the following error BUILD FAILED D:\build\db-ojb-1.0.1\build.xml:421: Following error occured while executing this line D:\build\db-ojb-1.0.1\build.xml:78: java.lang.UnsupportedClassVersionError: javax/transaction/Transaction (Unsupported major.minor version 48.0) after replacing the geronimo-spec-Files (geronimo-spec-j2ee-1.4-rc2.jar sounds suspicious) with the old j2ee.jar from former builds the build was successful again. Is JDK 1.3 no longer supported or am I just the only one who tried it with 1.3? Regards Lasse ___ > Lasse Lambrecht > Allianz Lebensversicherungs-AG > IS-LF1 K6, Produktdatenbank > +49 711 663 5412 # 1021-5412 Brian McCallister <[EMAIL PROTECTED]> Brian McCallister <[EMAIL PROTECTED]> 10/09/04 14:30 Bitte antworten an "OJB Users List" <[EMAIL PROTECTED]> An OJB Users List <[EMAIL PROTECTED]> Kopie Thema OJB 1.0.1 The OJB team would like to announce the release of the OJB 1.0.1. This is primarily a bug fix release with a couple performance improvements and the addition of one service api element. Full release notes: http://db.apache.org/ojb/release-notes.txt Binary and source downloads: http://www.apache.org/dyn/closer.cgi/db/ojb/db-ojb-1.0.1/ -OJB Team - 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: Optimistic Locking exception with 1.0 - doesn't happen with rc4
I presume you can reliably replicate it, can you provide more information about when it is happening? Database, mapping for the optimistic TX field etc? There were a couple changes to optimistic tx's when using a timestamp instead of version counter. Any chance you can send a unit test which causes this to happen? If not, enough information on exactly when it happens so that I can do so would be appreciated! -Brian On Sep 14, 2004, at 8:03 PM, Kollivakkam R. Raghavan wrote: I am getting the following exception with an optimistic locking which does not happen with rc4. Did something change? We are about to use OJB in production and I wanted to switch to the release version. Please help. Thanks Raghavan -- at java.lang.Thread.run(Unknown Source) Caused by: org.apache.ojb.broker.OptimisticLockException: Object has been modifi ed by someone else at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(JdbcAc cessImpl.java:485) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Persistenc eBrokerImpl.java:1641) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro kerImpl.java:1542) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro kerImpl.java:705) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Delegati ngPersistenceBroker.java:174) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Delegati ngPersistenceBroker.java:174) a:1770) ... 40 more Additional exceptions : 14-Sep-2004 16:23:42 WARN [010-Processor25] .broker.core.PersistenceBrokerImpl No running tx found, please only store in context of an PB-transaction, to avoid side-effects - e.g. when rollback of complex objects 14-Sep-2004 16:23:42 ERROR [010-Processor25] Database error: PersistenceBrokerException was caught org.apache.ojb.broker.OptimisticLockException: Object has been modified by someo ne else at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(JdbcAc cessImpl.java:485) at org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Persistenc eBrokerImpl.java:1641) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro kerImpl.java:1542) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBro kerImpl.java:705) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Delegati ngPersistenceBroker.java:174) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Delegati ngPersistenceBroker.java:174) - 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: Anonymous keys
Anonymous keys allow you to not have the FK field (or PK if you never need serialize them) defined on the classes. By default OJB talks directly to fields, not through property accessors (though it certainly can work through property accessors). -Brian On Sep 13, 2004, at 6:53 PM, Pulat Yunusov wrote: What is the purpose of anonymous keys? Given class A and class B where class A has a reference to class B, I removed setId() from both classes, and setBId() and getBId() from class A. I still have private members id in both classes, and bId in class A as well as all corresponding field and reference descritors in the mapping file. I have not set access to any of the fields as "anonymous" in the mapping file. Following that, I have no problem creating instances and setting a reference between them, persisting them or retrieving them. I thought you needed anonymous keys for that kind of behavior but I didn't use them. Can OJB access private instance variables to keep track of relationships? What exactly are anonymous keys for? Thank you, Pulat - 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: Lucene and OJB
On Sep 12, 2004, at 3:01 AM, Charles Anthony wrote: a) Implement org.apache.ojb.broker.PersistenceBrokerAware on the domain object : the domain object knows when it is being modified, and so can add itself to the index. Not such a good idea for many people, as your domain object is reliant on both Lucene && OJB, although perfectly feasible for a small project. Good idea! Use static advice (cross type stuff) and provide the callbacks and behavior via a mixin ;-) The model remains unaware of OJB or Lucene, but the behavior is placed where it makes sense -- on the model instances. -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Lucene and OJB
A while back I promised a howto/sample code for using OJB with Lucene for full text searches. Recently posted an article on just that: http://kasparov.skife.org/blog/src/java/ojb#lucene-ojb Thought I'd share, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 1.0.1
Nope, this was exactly the right place, thank you! -Brian On Sep 10, 2004, at 10:25 AM, David Durham wrote: Brian McCallister wrote: The OJB team would like to announce the release of the OJB 1.0.1. This is primarily a bug fix release with a couple performance improvements and the addition of one service api element. Full release notes: http://db.apache.org/ojb/release-notes.txt Binary and source downloads: http://www.apache.org/dyn/closer.cgi/db/ojb/db-ojb-1.0.1/ -OJB Team The torque-build.xml file contains: But OJB is still shipped with torque-3.0.2 It still works because at the bottom of the torque-classpath is: Anyway, is this something to report to the torque list? - Dave - 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]
OJB 1.0.1
The OJB team would like to announce the release of the OJB 1.0.1. This is primarily a bug fix release with a couple performance improvements and the addition of one service api element. Full release notes: http://db.apache.org/ojb/release-notes.txt Binary and source downloads: http://www.apache.org/dyn/closer.cgi/db/ojb/db-ojb-1.0.1/ -OJB Team - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: maven+ojb
I pushed the rc7 version into the ibiblio repository as well. I strongly recommend using 1.0.1, however, as it is all bug fixes between rc7 and 1.0.1 -Brian On Sep 9, 2004, at 7:45 PM, Pedro Salgado wrote: Thank you! :) That sure was quick!! On 10/9/04 12:44 am, "Brian McCallister" <[EMAIL PROTECTED]> wrote: http://www.ibiblio.org/maven/ojb/jars/ Includes the 1.0.1 I pushed last night. -Brian On Sep 9, 2004, at 7:38 PM, Pedro Salgado wrote: I am searching the ibiblio repository and I cant find ojb 1.0rc7 anywhere (just db-ojb-1.0.rc6.jar - 7 Apr 2004)... isnt it supposed to be on ojb/jars? I do see the ojb-xdoclet-module (16 Aug 2004)... Thank you, Pedro Salgado - 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: maven+ojb
Happy to help! I use maven too ;-) -Brian On Sep 9, 2004, at 7:45 PM, Pedro Salgado wrote: Thank you! :) That sure was quick!! On 10/9/04 12:44 am, "Brian McCallister" <[EMAIL PROTECTED]> wrote: http://www.ibiblio.org/maven/ojb/jars/ Includes the 1.0.1 I pushed last night. -Brian On Sep 9, 2004, at 7:38 PM, Pedro Salgado wrote: I am searching the ibiblio repository and I cant find ojb 1.0rc7 anywhere (just db-ojb-1.0.rc6.jar - 7 Apr 2004)... isnt it supposed to be on ojb/jars? I do see the ojb-xdoclet-module (16 Aug 2004)... Thank you, Pedro Salgado - 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: maven+ojb
http://www.ibiblio.org/maven/ojb/jars/ Includes the 1.0.1 I pushed last night. -Brian On Sep 9, 2004, at 7:38 PM, Pedro Salgado wrote: I am searching the ibiblio repository and I cant find ojb 1.0rc7 anywhere (just db-ojb-1.0.rc6.jar - 7 Apr 2004)... isnt it supposed to be on ojb/jars? I do see the ojb-xdoclet-module (16 Aug 2004)... Thank you, Pedro Salgado - 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: MSSQL And OJB/Torque issue with image datatype..Will Velocity solve my problem?
This is a limitation of (MS) SQL: [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException during the execution of the query (for a com.xxx.Property): The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. What does the actual SQL look like, and what does the query you are running look like? -Brian On Sep 8, 2004, at 10:07 PM, Ajitesh Das wrote: Hi: I want to store an *supersize* byte array into a db table. Below I have described the issues that I have. My question: How do I control SQL for Schema? Do I have to write my own Velocity template and add that path to db.profile. I have made the followings changes: DB Type : MSSQL In db-schema.xml: http://jakarta.apache.org/turbine/dtd/database.dtd";> type="VARBINARY" > type="VARBINARY" > It creates IMAGE datatype in MSSQL Server. In repository.xml: class="com.xxx.Property" table="PROPERTY" attribute-name="DB_NAME" attribute-value="mydb" name="dbId" column="ID" jdbc-type="INTEGER" primarykey="true" nullable="false" indexed="true" autoincrement="true" locking="false" default-fetch="false" /> name="propertyName" column="PROPERTY_NAME" jdbc-type="VARBINARY" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" default-fetch="false" conversion="com.xxx.yyy.Converter" /> name="propertyValue" column="PROPERTY_VALUE" jdbc-type="VARBINARY" primarykey="false" nullable="true" indexed="false" autoincrement="false" locking="false" default-fetch="false" conversion="com.xxx.yyy.Converter" /> When I run simple queryI get the following exception: but running in MySQL is fine. [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException during the execution of the query (for a com.xxx.Property): The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. java.sql.SQLException: The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.j ava:366) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:1992) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:1594) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:490) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement .java:262) at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPrep aredStatement.java:614) at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown Source) at org.apache.ojb.broker.accesslayer.RsIterator.(Unknown Source) at org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unk nown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQue ry(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery (Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorByQuery(U nknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getIteratorByQ uery(Unknown Source) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using OJB in a servlet container
A broker should be treated much like a JDBC connection. Obtain, use, close. I would definitely *not* put an open broker in the session or servlet context. Caching works across brokers (depending on the cache implementation used). -Brian On Sep 2, 2004, at 3:31 PM, Vincent Frison wrote: Hi all, I cannot find info explaining the good way to use OJB in a servlet environnement. A first basic question could be : can an unique broker instance stands during all the app/servlet life cycle (i.e. the broker is instancied once at servlet init) or a new broker should be instancied on each new HTTP session, or even on each HTTP request (reducing caching benefits I guess)? Thanks a lot.. PS: I had some difficulties to post to this ML, I'm sorry if this mail is finally posted many times.. - 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: i can't use OJB but i promise you i want to!
No problem. Could you post the snippets from your build.properties and repository_database.xml with the database information? Thanks, Brian On Aug 26, 2004, at 7:16 PM, [EMAIL PROTECTED] wrote: hi! Ok, sorry for the subject but it's true...I posted a few day ago and i still with the same problem. I want to use torque to generate my database schema but everytime i run the example i got the cannot get default properies message from [torque-sql] ant task what the hell am i doing wrong? I have the ojb-blank.jar unpacked, all the required libraries and the jdbc driver, the example in src/java, all the build.properties are exactly the same as the getting started tutorial,...what more do i need? Please, help!! Regards, Sergio - 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: Can't find OJB property files from inside tomcat...
It should be on your classpath, I typically put the OJB.properties, and repository_* in WEB-INF/classes -Brian On Aug 26, 2004, at 6:03 PM, Henrique Faria wrote: Hi! I'm trying to use the Persistent Broker API from inside a servlet environment (tomcat5 web container). The problem seems to be the web application can't find the OJB property files (OJB.properties, repository.xml). I get the following error: [BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object StandardWrapperValve[isoservlet]: Servlet.service() for servlet isoservlet threw exception java.lang.ExceptionInInitializerError java.lang.ExceptionInInitializerError at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker ( Unknown Source) Where do I have to put my property files, in this case? Or what do I have to configure in my web container (sorry if it isn't exactly in the scope of the list)? Thanks, Henrique Faria Senior Consultant Java Software Team tel:55.11.3285 4699 cel:55.11.9811 8281 fax: 55.11.3266 5121 [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: can i use cloudscape?
Chances are Cloudscape will work with the Default database impl, just reuce JDBC level until it works (that is how I am doing Axion at the moment, for example). I expect once we get Derby people on board we will build explicit support in. -Brian On Aug 17, 2004, at 11:30 AM, Charles Anthony wrote: Hi, OJB does not support Cloudscape "out-of-the-box", no, although one probably could make OJB support it. It does support HSQLDB, though, which is another open-source just-java database. Cheers, Charles. -Original Message- From: Saurabh Bhatla [mailto:[EMAIL PROTECTED] Sent: 17 August 2004 16:27 To: OJB Subject: can i use cloudscape? Hi all, Can i use cloudscape with ojb or do i need to use some other persistence frame work. Please help as i need to make a decision soon. regards saurabh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ HPD Software Ltd. - Helping Business Finance Business Email terms and conditions: www.hpdsoftware.com/disclaimer - 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: OptimisticLockException
What database are you using? I have hit (and not yet fixed =/) precision difference problems when dealing with postgres. -Brian On Aug 11, 2004, at 10:23 AM, Alessandro Colantoni wrote: Hi again. I saw that my problem is not in the OSCACHE, but in the locking. I set isolation level = optimistic in the jdbc connection descriptor, and I put in my table a field with locking=true Every time I do an update on an element of this table I got the OptmisticLockException. It looks like the element is never released. Have I to set any LockManager in the ojb.properies? I have to put in my code something to release the element? I tried to remove the cache with OjbCache cache broker.serviceObjectCache(); cASOcacheVO = (CASOVO)cache.lookup(oid) cache.remove(oid). But it still doesn't work I tried cahe.clear and still nothing. What I have to do? Please help me Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB vs Hibernate
On Aug 9, 2004, at 9:13 AM, Robert S. Sfeir wrote: P.S. Did you post this on Hibernate list??? :-) gack, I realize this is a joke, but... please don't! The last thing we need are more O/R pissing matches :-) -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB vs Hibernate
Glad to hear! The complexity of supporting many API's at different levels is frustrating at times -- is really nice to be reminded that people really make use of the higher performance options! -Brian On Aug 9, 2004, at 8:57 AM, Mcgough, Brian Joseph wrote: All, I just wanted to share some data points that were recently collected that compare OJB and Hibernate and the ability to scale with both. We had a data file with only 10,000 records in it that we needed to load into our database. Typically we use our batch environment, but given that we are a java shop now, we wanted to see if we could use java and our ORM tool to get the job done. We started out using Hibernate for this, and we found that we had some real problems. It just would not scale whether or not we were using transactions. We found that it would take greater than 17 hours to load only 7500 of the records. Obviously this is unacceptable performance, and so we thought to try the same thing using OJB. I am happy to report that using OJB we were able to load the whole file of 10,000 in under 12 minutes. In addition to this, we just recently upgraded a project from OJB 1.0 rc2 to OJB 1.0 and I am happy to report that for that particular project db performance was improve by a factor greater than 10. This is mostly due to the new implementation for FieldAccess. I just wanted to thank the developers for their attention to detail in regards to ensuring that the overhead above jdbc was minimal, and for all of the tests that they have written to ensure that is the case. We are very happy that we are still able to use ORM for this instead of straight jdbc, because the rest of the application is written using the ORM. Anyway I just wanted to share these points with the group, for those of you that are out there and are on the sidelines as far as which framework will scale better. Brian McGough IU - UITS - UIS - SIT (812) 856-4871 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB/JDO
On Jul 29, 2004, at 5:53 PM, Artur Z wrote: thanks form reply correct me if i'm wrong, but if everything will go as planed the apache JDO implementation will be ready by november ? That is my personal plan, not an official one, and is subject to the whims of the JDO expert group changing everything. In other words, it is a best guess on my part. -Brian Artur - Original Message - From: "Brian McCallister" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Thursday, July 29, 2004 11:27 PM Subject: Re: OJB/JDO On Jul 29, 2004, at 4:42 PM, Artur Z wrote: hello I searched the archive and I have not found answers so please tell me: - is it still impossible to use OJB/JDO in production (because of the sun's JDORI license) ? Yes - when apache implementation of JDO will be ready ? Good question. We are working on this, but can always use help =) I *hope* to have it production worthy and compliant with the JDO2 spec by november. - why JDO api is better than ODMG (I mean functionality, usability) ? It does support a few things ODMG doesn't -- attach/detach, efficient query by identity, explicit optimistic transaction support. -Brian only a few days left me for making decision about deep going into OJB, so please help me found the answers Best regards Artur - 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: OJB/JDO
On Jul 29, 2004, at 4:42 PM, Artur Z wrote: hello I searched the archive and I have not found answers so please tell me: - is it still impossible to use OJB/JDO in production (because of the sun's JDORI license) ? Yes - when apache implementation of JDO will be ready ? Good question. We are working on this, but can always use help =) I *hope* to have it production worthy and compliant with the JDO2 spec by november. - why JDO api is better than ODMG (I mean functionality, usability) ? It does support a few things ODMG doesn't -- attach/detach, efficient query by identity, explicit optimistic transaction support. -Brian only a few days left me for making decision about deep going into OJB, so please help me found the answers Best regards Artur - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ODMG and primary key assignment
To my knowledge there isn't, though it should be possible to implement (outside of ODMG, as I don't think ODMG provides a mechanism in its API). I am not sure how much rework of internal API's would be required, but as (in most cases) OJB assigns the PK itself it could be possible to do it early. I don't have a lot of spare cycles to dig into doing this right now, however. -Brian On Jul 26, 2004, at 3:38 PM, Saleem Shafi wrote: Hello, i have a quick question about when a primary key is assigned to an object using the ODMG interface provided by OJB.. i realize that the PersistentBroker.store() method will set the primary key property on the object, but the .lock() method on the ODMG transaction doesn't seem to do that for me.. i understand that the transactions are different between OJB and ODMG and that the object will get its ID after the ODMG transaction commits, but is there any way to get the ID assigned before that? Saleem. - 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: Example of 1:n
O/R mapping in general is complex =) Don't sweat the learning curve. Once I get some breakfast I'll look over your config and see if I can see anything. -Brian On Jul 23, 2004, at 6:16 AM, Joose Vettenranta wrote: Thanks, I got that and tried to implemet thing according to that file, but still not getting simple 1:n to work. I have also read the basic-technique.html file many times from top to bottom, bottom to top left to right and right to left.. With search with copy-pasting and I think I even tried calling ghostbusters to come and help me to get this simple 1:n relation to work -> but no luck. Eather this is very very complex thing or I'm just stupid and can't even implement something this simple. - Joose 22.7.2004 kello 15:57, Brian McCallister kirjoitti: I have a bunch of sample code online from a presentation I gave a few months ago. It includes different relation types, and IIRC, class-per-table inheritance. http://kasparov.skife.org/ojb-phillyjug.tar.gz -Brian On Jul 22, 2004, at 8:52 AM, Thomas Dudziak wrote: Joose Vettenranta wrote: is there anywhere working example how 1-to-many relation should work? I have now tried 3days to get it to work and I'm not able to get it to work. Have you checked the documentation: http://db.apache.org/ojb/docu/guides/basic-technique.html -- "Always remember that you are unique, just like everyone else!" * http://iki.fi/joose/ * [EMAIL PROTECTED] * +358 44 561 0270 * - 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: Example of 1:n
I have a bunch of sample code online from a presentation I gave a few months ago. It includes different relation types, and IIRC, class-per-table inheritance. http://kasparov.skife.org/ojb-phillyjug.tar.gz -Brian On Jul 22, 2004, at 8:52 AM, Thomas Dudziak wrote: Joose Vettenranta wrote: is there anywhere working example how 1-to-many relation should work? I have now tried 3days to get it to work and I'm not able to get it to work. Have you checked the documentation: http://db.apache.org/ojb/docu/guides/basic-technique.html 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: How to Develop a Search Page using QueryByCriteria
Typically you would create an index of the data in Lucene when it is inserted, or via a batch process, and then use lucene to return primary keys on the search in order to retrieve the actual data. In RDBMS terms, think of lucene as a full-text index on the various columsn you use, which also happens to index things much smarter =) You don't store any real data in Lucene, you simply use it for text searches, and then use the information returned from the lucene lookup to find the real data. Make any sense? -Brian On Jul 20, 2004, at 7:18 AM, Mike Young wrote: On Tue, 20 Jul 2004 06:10:49 -0400, Brian McCallister wrote: A slightly more complex, but considerably more powerful, search solution is to use the Lucene indexing engine to handle search instead of LIKE clauses. It requires building the indexes, but is very fast, and very effective for searching -- much more so in my experience than LIKE clauses. -Brian On Jul 20, 2004, at 5:29 AM, C.K, Shibin (Cognizant) wrote: check this out. i got this from QueryByCriteria class public Criteria buildCriteria (Object anExample) throws Exception{ Criteria criteria = new Criteria(); ClassDescriptor cld = MetadataManager.getInstance ().getRepository ().getDescriptorFor (anExample.getClass ()); FieldDescriptor [] fds = cld.getFieldDescriptions (); PersistentField f; Object value; for (int i = 0; i < fds.length; i++){ f = fds [i].getPersistentField (); value = f.get (anExample); if (value != null){ criteria.addEqualTo (f.getName (), value); } } return criteria; } change the addEqualTo to addLike accordingly shibin -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Mike Young Sent: Tuesday, July 20, 2004 2:50 PM To: [EMAIL PROTECTED] Subject: How to Develop a Search Page using QueryByCriteria I am trying to develop a search page that allows users to input their search criteria into a form and after submitting this form the application will list all records that match the search criteria. I currently have a form that captures the users input and places it into a bean. The bean is the same bean that i would use for gettting data from the table (i.e. it has getters and setters for each column). Where I need help is in writing a generic class that will build up the search criteria using addLike for each property of the bean that is not null without individually calling each of the getters and testing whether it is null or not before adding its value onto my criteria using addlike. Could anyone please point me in the right direction on how to acheive this? thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I have just had a very brief look at Lucene and guess that you might read a whole table into an object using OJB and then search through the oject using lucene. Doesn't this move all the processing from the database server to the web server? As an Oracle DBA and applications developer this kind of goes against the grain! Are there any good quick starts that you can point me at so that I can investigate this option? - 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: How to Develop a Search Page using QueryByCriteria
A slightly more complex, but considerably more powerful, search solution is to use the Lucene indexing engine to handle search instead of LIKE clauses. It requires building the indexes, but is very fast, and very effective for searching -- much more so in my experience than LIKE clauses. -Brian On Jul 20, 2004, at 5:29 AM, C.K, Shibin (Cognizant) wrote: check this out. i got this from QueryByCriteria class public Criteria buildCriteria (Object anExample) throws Exception{ Criteria criteria = new Criteria(); ClassDescriptor cld = MetadataManager.getInstance ().getRepository ().getDescriptorFor (anExample.getClass ()); FieldDescriptor [] fds = cld.getFieldDescriptions (); PersistentField f; Object value; for (int i = 0; i < fds.length; i++){ f = fds [i].getPersistentField (); value = f.get (anExample); if (value != null){ criteria.addEqualTo (f.getName (), value); } } return criteria; } change the addEqualTo to addLike accordingly shibin -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Mike Young Sent: Tuesday, July 20, 2004 2:50 PM To: [EMAIL PROTECTED] Subject: How to Develop a Search Page using QueryByCriteria I am trying to develop a search page that allows users to input their search criteria into a form and after submitting this form the application will list all records that match the search criteria. I currently have a form that captures the users input and places it into a bean. The bean is the same bean that i would use for gettting data from the table (i.e. it has getters and setters for each column). Where I need help is in writing a generic class that will build up the search criteria using addLike for each property of the bean that is not null without individually calling each of the getters and testing whether it is null or not before adding its value onto my criteria using addlike. Could anyone please point me in the right direction on how to acheive this? thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com - 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: OTM makePersistent Error.
Yeah, I ran into this one a few times myself. The OTM will attempt to shortcut some copying when it hits something it doesn't know how to copy by serializing and deserializing it. I don't much like this behavior, and in the end led to us not using the OTM for a project in the end. Unfortunately I cannot recall exactly when it was doing this, but it became a bear to work around for me as well. I will dig back into when it was happening and try to find our workaround. The right answer is to fix the OTM, but that is a much more complex task at the moment =/ -Brian On Jul 19, 2004, at 10:47 AM, Robert r. Sanders wrote: Hi, I've been following OJB for sometime now. I recently decided to switch a small web-app from using the PersistanceBroker to using OTM (I also updated from RC 6 to 1.0 final). After reading through the OTM tutorial, I changed my code to use OTM; however I get the following error when attempting to store new Objects. Is there some setting that I need to change or something? org.apache.ojb.otm.copy.ObjectCopyException: java.io.NotSerializableException: net.ipov.timesheet.TimeEntry at org.apache.ojb.otm.copy.SerializeObjectCopyStrategy.copy(Unknown Source) at org.apache.ojb.otm.copy.ReflectiveObjectCopyStrategy.handleObjectWithNo ArgsConstructor(Unknown Source) at org.apache.ojb.otm.copy.ReflectiveObjectCopyStrategy.clone(Unknown Source) at org.apache.ojb.otm.copy.ReflectiveObjectCopyStrategy.copy(Unknown Source) at org.apache.ojb.otm.copy.MetadataObjectCopyStrategy.clone(Unknown Source) at org.apache.ojb.otm.copy.MetadataObjectCopyStrategy.clone(Unknown Source) at org.apache.ojb.otm.copy.MetadataObjectCopyStrategy.copy(Unknown Source) at org.apache.ojb.otm.core.ConcreteEditingContext.insertInternal(Unknown Source) at org.apache.ojb.otm.core.ConcreteEditingContext.insert(Unknown Source) at org.apache.ojb.otm.core.BaseConnection.makePersistent(Unknown Source) -- Robert r. Sanders Chief Technologist iPOV www.ipov.net - 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: Question about OdmgImplementation
Thanks for the pointer, will try to get a patch in to the cocoon folks for 1.0.0 asap =) -Brian On Jul 13, 2004, at 4:34 AM, Johnson wrote: great it'ok tks lots Best Regards Johnson - Original Message - From: "Johnson" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Tuesday, July 13, 2004 4:27 PM Subject: Re: Question about OdmgImplementation I just use the cocoon had. I've check that it's different from 1.0 will try to see if work tks Best Regards Johnson - Original Message - From: "Armin Waibel" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Tuesday, July 13, 2004 4:13 PM Subject: Re: Question about OdmgImplementation Hi Johnson, did you update the OJB.properties file? We introduce a new factory ImplementationClass=org.apache.ojb.odmg.ImplementationImpl in OJB.properties file to define the used org.odmg.Implementation implementation. Maybe this cause the problem. regards Armin Johnson wrote: Hi! I Found if use db-ojb1.0rc7 had the same problem Best Regards Johnson - Original Message - From: "Johnson" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Tuesday, July 13, 2004 2:09 PM Subject: Question about OdmgImplementation Hi! I use odmg to connect postgres since cocoon 2.1.5 db-ojb is 1.0rc6 I upgrade to cocoon 2.2 dev db-ojb is 1.0.0 but the code is fail for getInstance(); the code is var odmgImpl = cocoon.getComponent(Packages.org.apache.cocoon.ojb.odmg.components.Odmg Imple metation.ROLE); var impl = odmgImpl.getInstance("sy"); If I change the db-ojb back to 1.0rc6 it's ok But in 1.0.0 java.lang.NullPointerException occurs How to correct it. Best regards Johnson --- -- 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] - 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: sharing Cache by 2 application
That is exactly how we suggest doing it in an EJB container, should work as well in a servlet container which supports JNDI. Look up the howto's on EJB deployment, it should workable. -Brian On Jul 9, 2004, at 8:35 AM, Danilo Tommasina wrote: Hi, Just an idea that I never tested... You could make the PersistenceBroker factory available as JNDI object shared between all applications. Then you can lookup your JNDI object and get a PersistenceBroker trough it. cheers Danilo Hi all, How to make for sharing one ojb cache whith 2 application and what is the special configuration for Ojb.properties and repository.xml I have TOMCAT +Oracle and Webapp 1 + Webapp 2 but I would be user one repository, one cache application 1 - - - OJB cache Oracle - application 2 - Thank you for the answer - 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: AW: Cache and Inheritance
Good find. Easiest way to get it fixed is to submit a patch ;-) Otherwise opening a bug in the bug tracker is good, and pinging us on -dev periodically if it doesn't seem anyone is acting on it. That said, this is pretty significant -- it also makes the cd.getTopLevelClass(..) call pretty tricky as it should be capable of returning a tuple now, butthat will break things left and right =/ -Brian On Jul 8, 2004, at 7:35 AM, Peter Wieland wrote: Hi again, I digged a little deeper. The problem occurs in fact, when a class is in more than one extent. In my example, Product implements two interfaces TextLinkable and ImageLinkable. I'm afraid this scenario was not one, OJB developers thougt about. In DescriptorRepository.addExtent(String classname, ClassDescriptor cld), mappings between extents and the class descriptors of their superclasses are stored. If interfaces come into play - i.e. one class may belong to more than one extent - the last extent added wins as each extent/superclass mapping uses the extent class name as unique key and thus previously registered mappings are simply overwritten. In my example, getBroker().getTopLevelClass(Product.class) returns ImageLinkable.class. Hence, it is not found in the cache when looking for it as a TextLinkable (Identity.equals() compares toplevel classes and OIDs). Is there an easy way to get this fixed? Regards, Peter PS: While writing this mail, I felt like this belongs more to the developer list. Maybe we can continue discussion there. I sent a copy to both lists. -Ursprüngliche Nachricht- Von: Peter Wieland [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 8. Juli 2004 10:48 An: [EMAIL PROTECTED] Betreff: Cache and Inheritance Hi all, I just wrote the following mail to the user list. Here it is a second more time for two reasons: 1) I used a mail account not subscribed to the list, hence I do not know whether it will be accepted. 2) I just updated my App for use with OJB 1.0. The problem did not change. So forget about my last question whether the problem is fixed or not in 1.0. It is NOT. Peter === Hi all, I have the following scenario: <> TextLinkable (0..*)---(0..1) TextModule And a class Product implementing TextLinkable (Product is declared as extent of TextLinkable in repository). It now appears that I have different instances of the same Product in my App which is not what I expect. Normally the use of a cache makes sure that persistent identity is equivalent to java identity (which works fine in most cases). I suppose that the cache does not correctly resolve identities when inheritance comes in to play. The TextModule class holds a dynamic proxy for the associated TextLinkable. Is it possible, that, when materializing this proxy, it does not find an existing Product (which would be the real object in this case) in the cache, because the cache is searched for classes of runtime type TextLinkable (there are none, as TextLinkable is an interface)? I observed the problem with OJB RC5. Is this a known problem? Anybody knows whether it is fixed in 1.0? Thanks for any help. Peter - 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: Problem with ODMG Transaction in servlet container
ODMG transactions are specifically tied to threads. The behavior you see when it sometimes works is if you *happen* to get the same thread again from the servlet container. To reattach to the transaction, call Transaction.join() on it before making any changes. Be very careful leaving an open transaction in the session -- it maintains an open database connection for the transaction. It is not difficult to chew up all database connections and get deadlocks in these cases. -Brian On Jul 4, 2004, at 9:08 AM, [EMAIL PROTECTED] wrote: Hello everybody, I am trying to implement a function with the ODMG API and Struts. The model is a 1:n relationship between objects of two types, let's say a class BankAccount that owns a collection of BankTransactions. In a first page the user chooses an account to manage, then the application shows a second page he inserts a Transaction. To do that, I open an ODMG transaction at the beginning end store it in the HTTP session. With this transaction I retrieve the BankAccount in the Struts Action corresponding to the first page and I store it also in the http session. In the second Struts action I create a new BankTransaction, add it to my BankAccount and try to do a checkpoint() with the stored transaction. This does not work every time. I get a "org.odmg.TransactionNotInProgressException: Calling method needed transaction, but no transaction found for current thread :-(". The whole stack trace is at the end of this mail. I looked a bit further and saw that LocalTxManager indexes the transactions in a hashmap by the Thread that registered them. Since I am in a servlet I have no warranty that two different http requests, as i have in my example, are managed by the same thread and this explains why sometimes it does not work (Actually, it works from time to time only because I am the only user of my developement server ;-)). I have serched the documentation and the users list, but did not find anything about this problem. Is there anywhere a parameter that I did not see right or is this a bug ? Thank you Stefano org.odmg.TransactionNotInProgressException: Calling method needed transaction, but no transaction found for current thread :-( at org.apache.ojb.odmg.LocalTxManager.getCurrentTransaction(LocalTxManager .java:50) at org.apache.ojb.odmg.locking.LockStrategyFactory.getIsolationLevel(LockS trategyFactory.java:83) at org.apache.ojb.odmg.locking.LockStrategyFactory.getStrategyFor(LockStra tegyFactory.java:54) at org.apache.ojb.odmg.locking.LockManagerDefaultImpl.upgradeLock(LockMana gerDefaultImpl.java:87) at org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:254) at org.apache.ojb.odmg.ObjectEnvelopeTable.upgradeImplicitLocksAndCheckIfC ommitIsNeeded(ObjectEnvelopeTable.java:260) at org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java :152) at org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.j ava:306) at org.apache.ojb.odmg.TransactionImpl.checkpoint(TransactionImpl.java: 441) at ch.admin.ofit.framework.persistence.ojb.odmg.PersistenceManagerOjbOdmgI mpl.storeState(PersistenceManagerOjbOdmgImpl.java:83) at ch.admin.formation.controler.creation.ControleurCreation.valideDecision (ControleurCreation.java:129) at ch.admin.formation.controler.creation.DecisionCreationEtat.transitionSu ivant(DecisionCreationEtat.java:49) at ch.admin.formation.controler.creation.MachineEtatsCreation.transmetTran sition(MachineEtatsCreation.java:35) at ch.admin.formation.struts.BusinessAction.perform(BusinessAction.java: 39) at org.apache.struts.action.ActionServlet.processActionPerform(ActionServl et.java:1787) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic ationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil terChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal ve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal ve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 480) at org.apach
Re: [ann] new release: OJB 1.0
Woo hoo =) Whee haw! -Brian On Jun 30, 2004, at 7:08 AM, Mahler Thomas wrote: Dear all, I'm very happy to announce the final 1.0 release of OJB. After a long series of release candidates we finally got enough confidence in our software to call it "ready for prime time". As you can see by our ever growing list of junit tests we pay attention to quality assurance. So the long delay of the 1.0 version was not caused by "laziness" but rather by our intention to deliver a piece of top quality software. I want to say thanks to all committers and contributors: You all helped to get OJB production ready! I also want to thank all users for their patience and I hope you all will be pleased by this 1.0 release! From the release notes: === = ObJectRelationalBridge -- Bridging Java Objects and Relational Databases === = ObJectRelationalBridge (OJB) is an Object/Relational mapping tool that provides transparent transactional persistence for Java Objects against relational databases. OJB provides ODMG and JDO interfaces. - Release 1.0 - NEW FEATURES: -- NOTES: -- CHANGES: - We introduce new PersistentField implementations in OJB.properties file called PersistentFieldImplNew. Per default one of the new PersistentField implementations was used. If you hit problems please send a report. You can reverting to old impl by changing property 'PersistentFieldClass' in OJB.prperties file. The new versions has much better performance in read/write nested fields (up to 50 times faster than the 'old' implementions) and will replace the old classes on next version. Because PersistentField is an important kernel class we wait for community response before final replacement. BUG FIXES: Please refer to our Bug tracking site (http://issues.apache.org/scarab/servlet/scarab/) under http://issues.apache.org/scarab/servlet/scarab/issues/id/OJBxxx to see details for a bug with id OJBxxx. KNOWN ISSUES: - The default ojb escape character '\' does not work for database using the same default as well and should therefore be double-escaped. As a workaround always use a custom escape character: LikeCriteria.setEscapeCharacter('|'); Criteria crit = new Criteria(); crit.addLike("firstname", "h%|%"); This issue is fixed for MySql and PostgreSql so far. - odmg-api: If a user exchange already existing objects in 1:n references without changing the size of the collection, the main object will not become dirty and the FK values of the exchanged objects will not be updated. E.g. two objects obj_1 anf obj_2 with 1:n reference to ref objects, each with one existing/persistent reference object, obj_1{ref_1} and obj_2{ref_2}. Lock objects and exchange the references in collection obj_1{ref_2} and obj_2{ref_1} and commit --> FK values of ref_1 and ref_2 will not be updated. - odmg-api: Creation of m:n relation only works when objects created step by step (or use PB-api as workaround), persist a whole object graph seems not to work proper. - ReportQueries should not be used with columns referencing Classes with extents: ReportQueryByCriteria q = QueryFactory.newReportQuery(ProductGroup.class, crit); q.setAttributes(new String[] { "groupName", "sum(allArticlesInGroup.stock)", "sum(allArticlesInGroup.price)" }); q.addGroupBy("groupName"); ProductGroup.allArticlesInGroup points to class Article having multiple extents. As a workaround the query can be 'reversed' : ReportQueryByCriteria q = QueryFactory.newReportQuery(Article.class, crit); q.setAttributes(new String[] { "productGroup.groupName", "sum(stock)", "sum(price)" }); q.addGroupBy("productGroup.groupName"); Due to the fact the Article has extents multiple selects will be executed, so the same ProductGroup may show up more than once. Please see the testcases QueryTest#testReportQueryGroupByExtents1 and QueryTest#testReportQueryGroupByExtents2. - A count on ReportQueries containing groupBy does not deliver a correct result. - Batch handling doesn't work proper with optimistic locking. This will be fixed before long after 1.0 enjoy, Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB + tomcat + OJB.properties
Are the repository xml files all in WEB-INF/classes/ as well? -Brian On Jun 23, 2004, at 4:12 PM, WHIRLYCOTT wrote: Actually, there is a default descriptor in my repository.xml file. I know that these files are well formed and contain valid information because I'm using them as-is within my dev environment without any problems. It seems to be some kind of an issue of the files not being loaded properly...? _ dbalias="//xxx:1433" username="xxx" password="xxx"> _ phil. Charles N. Harvey III wrote: Just like it says. There is no "default" descriptor. Somewhere in repository.xml there are s. One of them must have: default="true". If not, OJB complains. Charlie WHIRLYCOTT said the following on 6/23/2004 4:00 PM: Greetings, I'm working away quite happily here with some code using OJB from inside Eclipse. However, now that I've started integrating this code into a webapp using Struts, I'm getting an exception that indicates that OJB is having some trouble reading the OJB.properties file. It's located in $TOMCAT/webapps/appname/WEB-INF/classes/OJB.properties, which I believe is correct. I also have my repository.xml file in the same directory. Ideas? phil. 2004-06-23 15:51:40 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.ojb.broker.PBFactoryException: There was no default-PBKey specified at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.defaultPe rsistenceBroker(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBrok er(Unknown Source) at com.something.lst.AbstractBaseFacade.(Unknown Source) at com.something.lst.LetterDefinitionFacade.(Unknown Source) at com.something.appname.actions.LetterLibraryAction.execute(Unknown Source) at org.apache.struts.action.RequestProcessor.processActionPerform(Reques tProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Whirlycott Philip Jacob [EMAIL PROTECTED] http://www.whirlycott.com/phil/ - 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: ODMG documentation?
Sadly, the best I know of is the FastObjects community web site. It requires free registration, but has a good ODMG reference available for download. http://community.fastobjects.com/supportweb/docu.nsf/OSS_61/ 3EFAFE80A7855AEBC1256A4C004FE2E2?opendocument -Brian On Jun 23, 2004, at 9:17 AM, Keith Rogers wrote: I found this quite useful: http://www.comp.brad.ac.uk/~sahmed8/recommended.html [EMAIL PROTECTED] 21/06/2004 13:36:41 >>> Hi, Can anybody tell me which is/are the most complete source/s of ODMG documentation? What I want to know is how to make complex (real-life!) querys through ODMG. Thanks in advance! -- Saludos, Martin I. Levi Centre Tecnològic de Transferenciència de Calor Universitat Politècnica de Catalunya www.cttc.upc.edu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The information in this e-mail is confidential and intended to be solely for the use of the addressee(s) and may contain copyright and/or legally privileged information. If you are not the addressee (or responsible for delivery of the message to the addressee) please e-mail us at [EMAIL PROTECTED] and delete the message from your computer; copying, distribution, use or disclosure of its contents is strictly prohibited. As Internet communications are capable of data corruption no responsibility is accepted for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice contained in any e-mail without obtaining written confirmation of it. In addition, no liability or responsibility is accepted for viruses and it is your responsibility to scan attachments (if any). Please note that for business purposes, outgoing and incoming emails from and to the company may be monitored and recorded. Mouchel Parkman UK Ltd, Registered in England at West Hall, Parvis Road, West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040 - 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: Timestamp problem with Optimistic Locking
Michael, Thank you for digging into this, I noticed the same behavior on postgres as well. If you want to track down the materialization code, start in org.apache.ojb.broker.accesslayer package. On Jun 23, 2004, at 1:01 AM, Michael A. Hovan III wrote: Hello, I have been debugging a problem (for way too long) which has been exhibiting itself by intermittently throwing an OptimisticLockException. After this exception is thrown once, it is no longer possible to save the associated object back to the database. I have an "Optimistic Lock Handler" which: sleeps for a short random amount of time, re-fetches the object, makes the appropriate changes again and attempts to store the newly fetched object. Once I hit one of these "bad" OptimisticLockException's the handler (and later phases of the program) are never able to store a newly selected copy of the object, I just continue to get more OptimisticLockException's on every store attempt. This handler works fine in situations where I encounter a "good" OptimisticLockException (one where the store succeeds on the second attempt). It can be very time consuming to reproduce this problem in my development environment taking many thousands of stores to trigger a "bad" OptimisticLockException. I finally got around to inserting p6spy into the project and created a detailed trace of the SQL which was flowing between OJB and the Oracle driver. This trace revealed a peculiarity in the "update ... where ..." statement which was sent to the database right before the "bad" OptimisticLockException was thrown. Basically the Timestamp value in the where clause was wrong; the milliseconds portion was not the value which was set in the previous update statement (which is the same as the database value). Every attempted fetch & store of this object after this had a different (seemingly random) Timestamp milliseconds value in the where clause, while the rest of the Timestamp was always the same. A possibly interesting point, the milliseconds value of the Timestamp in the database was 0. Stripped down "pseudo-sql" of what I am seeing in the p6spy trace file looks like this: success:update set ... lastModified = '2004-06-22 14:38:05.0' where ... exception: update set ... where ... lastModified = '2004-06-22 14:38:05.928' exception: update set ... where ... lastModified = '2004-06-22 14:38:05.41' exception: update set ... where ... lastModified = '2004-06-22 14:38:05.273' exception: update set ... where ... lastModified = '2004-06-22 14:38:05.453' exception: update set ... where ... lastModified = '2004-06-22 14:38:05.08' Based on the above information it appears as if something involved with the materialization of the Timestamp value from the database may have a failure condition in the 0 milliseconds scenario. This application is significantly multi-threaded with database work happening on multiple concurrent threads. Hardware is significantly multiprocessor (16-way on the development box). The core software environment is: Java 1.4.2_03 Solaris Oracle 9i using OCI driver OJB 1.0rc4 JBoss 3.0.7 I experimented with OJB 1.0rc6 & JBoss 3.2.3 several weeks ago and appeared to have the same problem. I have not tried this combination with p6spy yet. I have created a simple standalone multi-threaded test application outside of the application server, but I have not been able to reproduce the problem. Does anyone have any suggestions on how to track down where the Timestamp value is being materialized incorrectly? My p6spy configuration skills are not particularly good, so I was not able to log the resultset which was being returned from the database driver. Hope the message is not too incoherent, it is getting a bit late here... Thanks in advance for any debugging suggestions. Mike - 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: Broken link
Much appreciate all the feedback. We recently changed our site generation system to forrest, so there are a few kinks. -Brian On Jun 19, 2004, at 6:13 PM, Pedro Salgado wrote: 3. Additional jar archives http://db.apache.org/ojb/dependencies.html (broken link) JARs also seem to be outdated :( Don't get me wrong. I really like OJB and I think you are doing a great job. Pedro Salgado - 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]
[ANN] OJB 1.0rc7 Released
The OJB team would like to announce the release of Apache Object/Relational Bridge (OJB) 1.0rc7. This release will hopefully be the final release candidate before version 1.0. If no major problems are discovered, OJB 1.0 will be released in one week. DOWNLOADS http://db.apache.org/builds/ojb/ CHANGES: - New Apache Forrest generated web site. - OJB.properties file has changed, don't forget to replace on update! One new property to set in managed environments. - Logging settings have moved to separate OJB-logging.properties file - Logging initialization is now decoupled form OJB initialization; this is described in the new reference guide for logging - It is no longer necessary to provide an empty repository.xml file when starting without repository and connection descriptors - rename/move internal package org.apache.ojb.odmg.transaction to org.apache.ojb.broker.transaction.tm In managed environments each (top-level) API use transaction manager access, thus the TM related classes are moved to the PB kernel and OJB.properties entries change. - Base class for ODMG api access within non- or managed environments is now org.apache.ojb.odmg.OJB. The used org.odmg.Implementation interface implementation is specified in OJB.properties. - ConnectionManager is more strict on CM.releaseConnection() method calls. Now an exception is thrown when CM is in a "local transaction" status when try to release the connection. The local tx status of ConnectionManager and PersistenceBroker implementation is now decoupled, useful in managed environments allows to "close the connection" without change the PB tx-state. - the indirection handler (for reference proxies), and the list and set proxy classes can now be configured in the OJB.properties file - new CollectionProxy interface introduced to allow the ODMG api to make use of alternate collection proxy implementations. KNOWN ISSUES: - odmg-api: It is not possible to exchange objects in 1:n references. - odmg-api: Creation of m:n relation only works when objects created step by step (or use PB-api as workaround), persist a whole object graph doesn't work. On delete of collection objects from a m:n relation objects will be deleted from the indirection table and (unexpected behaviour) from the referenced table too. - A count on ReportQueries containing groupBy does not deliver a correct result. - Batch handling doesn't work properly with optimistic locking. - ReportQueries should not be used with columns referencing Classes with extents. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: My proxies do not make late binding
I was just poking around ODMG to fix the collection proxy thing, can nose around about regular references. I probably won't get a chance to look at it until tomorrow night at the earliest, so if anyone else has a moment sooner... =) Thank you for finding the problems! -Brian On Jun 14, 2004, at 7:36 AM, [EMAIL PROTECTED] wrote: Yes, I am using ODMG. I have downloaded RC7 this morning and tried again. The collection proxy works fine, but I still have problems with the reference proxies. Here is the code snippet I am executing : public void testModificationDirect() { String idDossier = "test.ojb.1000"; try { Implementation impl = OJB.getInstance(); Database db = impl.newDatabase(); db.open("TESTDEV", Database.OPEN_READ_WRITE); Transaction tx = impl.newTransaction(); tx.begin(); OQLQuery q = impl.newOQLQuery(); q.create("select dossiers from " + DossierImpl.class .getName() + " where id = $1"); q.bind(idDossier); DList results = (DList) q.execute(); Dossier d = (DossierImpl) results.iterator().next(); assertNotNull(d); tx.lock(d,Transaction.WRITE); for (Iterator iter = d.getPrestations().iterator(); iter.hasNext();) { Prestation prest = (Prestation) iter.next(); prest.setMontant(prest.getMontant().add(new BigDecimal("100"))); } tx.commit(); } catch (Exception e) { e.printStackTrace(); fail(); } } The object of type Dossier is retrieved correctly. It has a real RemovalAwareCollection of non materialized proxies. But then arise the problems : - at the first method invocation on one of the proxies (prest.setMontant(...)) all the proxies of the collection are materialized, not only the current one; - at the commit, the real objects are not stored in the database. The java object are updated, but OJB does not realise that they were and does not report the new state in the database. If I try without proxies, the update is made. If I put a proxy on the collection, everithig works fine too. I don't join other information for now, just ask me what you need to dignosticate the problem. Stefano |-----+---------> | | Brian McCallister | | | <[EMAIL PROTECTED]| | | ompany.com> | | | | | | 11.06.2004 17:57 | | | Veuillez répondre à | | | "OJB Users List" | | | | |-+-> -- | | | |Pour : "OJB Users List" <[EMAIL PROTECTED]> | |cc : | |Objet : Re: Réf. : Re: My proxies do not make late binding | -- | Assuming you are using ODMG... The problem was with the implicit locking mechanism in the ODMG implementation. It was not properly detecting collection proxies so it would iterate over the collection (loading it) and lock every object before even returning from the OQLQuery#execute() call. I have fixed this in cvs so that it will register itself as a materialization listener on any implementation of CollectionProxy which has not yet been loaded, and only bind the contents of the collection to the transaction if the collection is loaded during the transaction. If you are using the default proxies, you should be fine if you pull the version from CVS, or use the release coming up (if Thomas D. retracts his vote to go to 1.0 final instead of an rc ;-) this weekend. -Brian On Jun 11, 2004, at 11:45 AM, Thomas Dudziak wrote: On Fri, 11 Jun 2004 [EMAIL PROTECTED] wrote: I looked at the URL you sent me, but I dont know enough the internals of OJB to understand the message. I went a little further : I tried to get the Persistence Broker from the transaction and to execute a good old OJB QueryByCriteria : the late binding works. Yup, the problem is with ODMG, not with the PB Api. Besides that, I am not sure that the problem is only w
Re: Réf. : Re: My proxies do not make late binding
Assuming you are using ODMG... The problem was with the implicit locking mechanism in the ODMG implementation. It was not properly detecting collection proxies so it would iterate over the collection (loading it) and lock every object before even returning from the OQLQuery#execute() call. I have fixed this in cvs so that it will register itself as a materialization listener on any implementation of CollectionProxy which has not yet been loaded, and only bind the contents of the collection to the transaction if the collection is loaded during the transaction. If you are using the default proxies, you should be fine if you pull the version from CVS, or use the release coming up (if Thomas D. retracts his vote to go to 1.0 final instead of an rc ;-) this weekend. -Brian On Jun 11, 2004, at 11:45 AM, Thomas Dudziak wrote: On Fri, 11 Jun 2004 [EMAIL PROTECTED] wrote: I looked at the URL you sent me, but I dont know enough the internals of OJB to understand the message. I went a little further : I tried to get the Persistence Broker from the transaction and to execute a good old OJB QueryByCriteria : the late binding works. Yup, the problem is with ODMG, not with the PB Api. Besides that, I am not sure that the problem is only with the collection proxy. I have also tried with single-object dynamic proxies and the same result (returns already materialized proxies). They should work (might depend on how old the OJB version is that you're using though). As I said, please try the latest from CVS. Wish you a happy week-end Same for you :-) 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: Dynamic Proxy and JDO plugin
Unfortunately the JDO plugin doesn't respect proxies -- it is a pain =/ We are working on JDO 1.0.1 right now, and intend to do 2.0 as soon as possible. There has been some discussion of not bothering with a native 1.0.1 in favor of going straight for 2.0, but as the 2.0 spec isn't released yet... -Brian On Jun 10, 2004, at 6:55 AM, [EMAIL PROTECTED] wrote: Hi all, I am trying to use the JDO plugin API with OJB, but I am getting an Out of Memory Error when i try to obtain a list of Clients from an informix Table. The table stores over a million records. Is there any way of getting round this problem using JDO. I know with the Persistence Broker interface you have the option of using an Iterator instead of a collection or you can make use of proxies. Is it possible to use dynamic proxies with the JDO plugin. If not, then does anyone know when the version of OJB that incorporates JDO will become available. Thanks in advance, Andrew Peirson. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: VARCHAR primarykey based upon OJB HighLow sequence in SQL Server 2000
Glad to hear! Sometimes I despair at some of the complexity having so many things pluggable brings us, then you hear stories like this =) -Brian On Jun 10, 2004, at 1:23 AM, Sean Dockery wrote: For posterity, overriding the single method worked, but I had to do two other things: 1) Change the internal OJB descriptors such that the jdbc-type was a BIGINT instead of an INTEGER. 2) Changed the OJB_HL_SEQ schema such that the max_key column was created as a bigint instead of an int. I seeded the OJB_HL_SEQ table with a record having a max_key value of $F000 (in decimal form) and everything worked as expected. Far easier than I expected. :-) "Sean Dockery" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello, I am working with a content-heavy database application that uses OJB 1.0RC5 on SQL Server 2000. Because the content is part of the value-proposition for customers to purchase our application, we would like a means of easily identifying what (template) data came from us versus what data was created by customers during their use of the application. The hope is that we can have a primarykey of a VARCHAR type that contains the hexadecimal format of the uniqueID issued by the HighLow sequence manager implementation. For example, our customer records would begin at $F000 for records that they create. Everything from $ to $EFFF would be part of our template data. I have the source code to the version of OJB that we're using, but I am unsure where I should make the change? Can I get away with just sub-classing SequenceManagerHighLowImpl and overriding the getUniqueValue method? Here's the implementation that I had been thinking of... public Object getUniqueValue(FieldDescriptor field) throws SequenceManagerException { Object value = super.getUniqueValue(field); if ("VARCHAR".equals(field.getColumnType())) { value = Long.toString(Long.parseLong(value.toString()), 16); } return value; } There are tables in the application which use the hi/lo manager for legitimate integer unique ids; I don't want to interfere with that operation. Any comments? Thanks in advance for your help. - 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: Update strategy
Stefano, The ODMG and OTM api's provide dirty tracking right now. Updates are figured out and executed on transaction commit =) -Brian On Jun 3, 2004, at 10:50 AM, [EMAIL PROTECTED] wrote: Bonjour à tous ! I am planning to develop an application with OJB. This application will access quite a lot of objects and update only some of them. I do not want to track in the model layer if an object was updated or not, I would rather like to delegate this task to my persistence layer built upon OJB. The simplest algorithm I see is to call PersistenceBroker.store() for every object in the cache but, since most of the objects that are read do not need to be updated, this way is not practicable because it would lead to far too much DB access. I had then the idea to customize the OJB proxy-mechanism to keep track of the updates to the real objects after their materialization, but I did not find any documented way to do that. Third idea : customise the cache to keep a copy of the data that was read from the DB at the materialisation of an object. With that information it would be easy to test if the data has been updated by the user or not. Unfortunately, I don't know how to be informed of the materialisation of the objects. Has someone a hint ? Stefano Juri - 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]
OJb Blog entry
Found this =) http://blog.w1c.ca/index.do?post=40288383fce5876c00fce6365cac0011 -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OTM documentation
The ODMG api works fine in one JVM. It also works fine on really distributed ones =) Another in-jvm database worth considering is Axion ( http://axion.tigris.org/features.html ) -- it is transactional, but development seems to have slowed on it as the last release was almost a year ago =/ -Brian On Jun 2, 2004, at 8:19 AM, Maksimenko Alexander wrote: Brian McCallister wrote: The OTM is usable, but I wouldn't use it for critical apps quite yet. FWIW, we maintain ODMG and OTM implementations of our repository side by side and they both work fine in all cases so far -- the ODMG is in production though, not the OTM =/ I would call the OTM released-but-unstable in 1.0 and ODMG stable. ODMG can provide the same object-space transaction isolation you are looking for, I think. I've read that ODMG is for massive distribute environments, but my application runs in one JDK and my database runs in same jdk (I find that only hsql is LGPL and can work in the same jdk, but it didn't have transaction isolation). Does anybody try to use LockManager without OTM ? -- Maksimenko Alexander Softwarium, www.softwarium.net - 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: OTM documentation
The OTM is usable, but I wouldn't use it for critical apps quite yet. FWIW, we maintain ODMG and OTM implementations of our repository side by side and they both work fine in all cases so far -- the ODMG is in production though, not the OTM =/ I would call the OTM released-but-unstable in 1.0 and ODMG stable. ODMG can provide the same object-space transaction isolation you are looking for, I think. -Brian On Jun 2, 2004, at 7:13 AM, Maksimenko Alexander wrote: Armin Waibel wrote: I want use OTM to isolate transactions (hsqldb can't do this) Is there any documentation (except tutorial) to understand the principles of its wor? sorry, AFAIK no. The OTM-api will be officially released in 1.1 version, till then the lack of OTM docs will in all probability continue. So, does it mean OTM not redy for production environment? Can I use Lock Manager without OTM ? -- Maksimenko Alexander Softwarium, www.softwarium.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB and XML databases
There is no support for XML databases in OJB at present, but it could certainly be done. I would be quite interested in seeing how this could work out, personally. I cannot commit a lot of time to working on it though, as my foreseeable-future efforts are already accounted for =( I'd be quite happy to help with ideas though =) A possible route forward might be to use one of the Java Object <-> XML mapping tools (XMLBeans, JAXB, XStream, etc) and then persist the java classes. This would do xml -> relational databases but would be far from optimal. A better path forward might be a JDO layer on top of the XMLDB api (which Xindice implements). The transactions would only be at the Java layer (XMLDB doesn't support transactions) but a compliant implementation is definitely doable. Large chunks of OJB can probably be reused for this (heck, Thomas M. implemented a PB API on top of Prevayler =). -Brian On May 22, 2004, at 9:48 PM, [EMAIL PROTECTED] wrote: Hi, just looking for some advice regarding the design of a database application that is required associate archives of XML datafiles with more conventional relational type data. Each XML file will be approximately 10-50K bytes and the archive rate will be more than 50,000 files / year. I would like to use Ojb as the mapping layer. Is there a standard practice for handling XML files in association with Ojb. Should they be stored within the RDBMS - or just as disk files with a look up key? I have read that there is Ojb activity to develop support layers for XML-based databases? If so would Apache Xindice be a suitable candidate for an XML database? Thanks in advance, Marcus - 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: OTM transaction isolation
The OTM does use its own (as well as anything the database provides, if you want it to) transaction isolation system. The transaction semantics are the same, I believe, as for the ODMG. -Brian On May 13, 2004, at 11:30 AM, Maksimenko Alexander wrote: Hi ! I have to use hsqldb as my database. But it doesn't support transaction isolation So I want to use OTM as transaction management system. Does it use own transaction isolation mechanizm (not database specific)? -- Maksimenko Alexander Softwarium, www.softwarium.net - 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: Hibernate don't manage locks bewtween several JVMs...
It may be worthwhile to have database-lock pessimistic locking as a clearly labeled option (non-default) in order to cut short these periodic discussions =) I'd be all in favor of bundling a DatabaseLockManager along with the current implementations. A fair number of people prefer this behavior. -Brian On May 10, 2004, at 3:21 PM, Thomas Mahler wrote: Hi NiX, Ojb provides several Locking strategies. You can use Optimistic locking based on versioning. Or you can use pessimistic locking. The pessimistic locking mechanism is implemented as a pluggable component. We ship two implementations: 1. an in-memory Lockmanager implementation that can be used if all transactions to manage reside in the same JVM. 2. a LockManagerServlet implementation that can be used if transactions across multiple JVMs must be coordinated. Since RC5 this second solution does not require any additional database table. instead the LockServerServlet manages a large lock map in memory. This new solution is not yet documented properly... The discussion between the Hibernate and OJB teams about the pessimistic locking is rather old. Finally we came to a solution: we agree to disagree in this point. Hibernate folks seem to say pessimistic locking should be done in the database. They give their reasons in their replies to your mail. OJB die-hards tend to think that pessimistic locking belongs into the O/R layer. Here is why: 1. pessimistic locking is implemented differently by different database vendors. The DB2 concept of lock escalation (in case of lock-memory shortage the whole table gets locked) is unique. Oracle works different. So if we rely on DB managed locking the same application would behave differently if running against DB2 versus running against Oracle. 2. We think that Object level locking that is required by Object level transactionmanagement systems like JDO or ODMG can most efficiently be handled on the object level. If you place a lock on the root element of a large tree structure you'll have to traverse the whole tree and to lock each object contained in that tree. If object level locking in a JDO transaction have to be translated at runtime into database "locks for update" you'll have a lot of db calls for the locking stuff. With OJBs simple lock-hashtables this job is much faster. Because of our strong support for OODBMS APis like ODMG and JDO, OJB works more as an ObjectDatabase than a simple O/R mapper. 3. if you still think that locks should be kept in the DB, just go ahead. Simply write your own LockManager implementation class that uses database locks and plug it into OJB. I don't say the Hibernate answer is wrong. But IMHO the OJB answer is more complete and flexible. cheers, Thomas Can you give me your opinions about answers i was given on the hibernate forum: http://forum.hibernate.org/viewtopic.php?t=930648 Thanks -- -NiX- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Der WEB.DE Virenschutz schuetzt Ihr Postfach vor dem Wurm Netsky.A-P! Kostenfrei fuer alle FreeMail Nutzer. http://f.web.de/?mc=021157 - 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: Problem with OJB-JDO plugin and proxy classes
I believe, though lack first hand knowledge, that Thomas M. said the JDORI plugin doesn't work with proxies. That is its big drawback =( -Brian On May 4, 2004, at 4:16 AM, Alexandre BOISSEAU wrote: Hi, I have problems when using proxy class : With the tutorial example : Loading of Article objects for a given ProductGroup works correctly, but when I try to load Article objects only, the search always returns nothing. Removing proxy from Article class-descriptor fixes the problem (search works correctly). Any suggestions? Thanks in advance, Alexandre -- Alexandre BOISSEAU Université de Rennes1 - 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: [JDO] Can I use a proxy with the JDO implementation ?]
Proxies are configured in the repository metadata: http://db.apache.org/ojb/repository.html =) -Brian On Apr 30, 2004, at 3:52 AM, Alexandre BOISSEAU wrote: Hi, I have to deal with large objects with OJB and I sense I will get into trouble with some performance issues if data is loaded each time objects are created. I saw some examples using the org.apache.ojb.broker.VirtualProxy class but I don’t manage to… Anybody having had such experience? Regards, -- Alexandre BOISSEAU Université de Rennes1 - 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: client/server Object Caching [Very Urgent]
You are effectively operating in a cluster, where your workstations are also cluster nodes: http://db.apache.org/ojb/howto-work-with-clustering.html -Brian On Apr 29, 2004, at 7:53 AM, Amol Pophale wrote: Hi Brain Thanks a lot for urgent reply. You said I need to use one of the distributed caches (JCS, OSCache, or Coherence) can u please tell where i can get details info about this or if u know can u tell me by some example or where can i get that API help etc. I mean more detail. Note:do u anything about PersistanceBrokerClient class? Thanks Amol --- Brian McCallister <[EMAIL PROTECTED]> wrote: > You need to use one of the distributed caches (JCS, OSCache, or Coherence). The other option, which tends to be the easiest, is to use a per-broker cache (non-distributed) and optimistic transactions, in which case you acknowledge that data in cache for the lifetime of one broker (usually short depending on how you use it) may be dirty if ti is in contention. This doesn't work for highly contentious data, however. -Brian On Apr 29, 2004, at 5:30 AM, Amol Pophale wrote: Hi All, I just learned OJB. I have written one application in OJB. My application is client-server application in which client and server are on different machines and using same databse which may be on third machine. Right now i have one query. server stores some java object in databse using PersistaceBroker APIs. Client retrives these object on its machine using same i.e. OJB Now if any object is updated by server which is in client object cache How can we update client object cache when server updates the object in database. Because I think server cache and client cache are different. I need this very urgent. Thanks in advance Amol Pophale. Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - 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] Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - 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: client/server Object Caching [Very Urgent]
You need to use one of the distributed caches (JCS, OSCache, or Coherence). The other option, which tends to be the easiest, is to use a per-broker cache (non-distributed) and optimistic transactions, in which case you acknowledge that data in cache for the lifetime of one broker (usually short depending on how you use it) may be dirty if ti is in contention. This doesn't work for highly contentious data, however. -Brian On Apr 29, 2004, at 5:30 AM, Amol Pophale wrote: Hi All, I just learned OJB. I have written one application in OJB. My application is client-server application in which client and server are on different machines and using same databse which may be on third machine. Right now i have one query. server stores some java object in databse using PersistaceBroker APIs. Client retrives these object on its machine using same i.e. OJB Now if any object is updated by server which is in client object cache How can we update client object cache when server updates the object in database. Because I think server cache and client cache are different. I need this very urgent. Thanks in advance Amol Pophale. Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html - 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: Problem with clearing cache
Anonymous PK's are risky things -- I apologize for using them in the original anonymous keys tutorial. Anonymous FK's are great, and not using them is usually a bad ida in my opinion =) I don't think the anonymous PK issues you are having will be resolved very soon, the anonymous key functionality wasn't really designed for PK usage, but for FK usage. I completely feel that it would be good to be able to use them for PK's as well, but my slate is full at the moment with JDO stuff =( I don't know about everyone else. Any chance *you* want to dig into it? ;-) -Brian On Apr 22, 2004, at 7:55 AM, Guillaume Nodet wrote: It also seems that cached anonymous keys are not removed from the cache when an object is deleted from database. Will these problems be solved, or should i try not to use anonymous keys ? Guillaume -Message d'origine- De : Guillaume Nodet [mailto:[EMAIL PROTECTED] Envoyé : mercredi 21 avril 2004 14:42 À : OJB Users List Objet : Problem with clearing cache I need to clear the ojb cache at some point in my program (namely after deleting all data in the database). The problem i have is that i use anonymous primary keys and the caches associated with the anonymous fields are not cleared. Would it be possible to had some mean of clearing these caches ? The problem is that at some time, i've got errors when inserting objects. I think that the key for the failing object is in cache but not in the database so when a foreign key references it, the insertion fails. Thanks, Guillaume Nodet - 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: Problem with clearing cache
I would tend to say that using anonymous primary keys and clearing the cache are mutually exclusive operations, unfortunately, as the cache is where the primary keys are stored. Is using a per-broker cache an option? If so you will effectively have the cache cleared every time you obtain a new broker/close a broker. -Brian On Apr 21, 2004, at 8:52 AM, Guillaume Nodet wrote: I thought i could replace the default implementation of persistend field with my own, but i saw no way of doing this for anonymous fields. Why is this class not configurable along with the other ones in the ojb configuration file ? I know my needs may be very specific, but ... Cheers Guillaume Nodet -Message d'origine- De : Guillaume Nodet [mailto:[EMAIL PROTECTED] Envoyé : mercredi 21 avril 2004 14:42 À : OJB Users List Objet : Problem with clearing cache I need to clear the ojb cache at some point in my program (namely after deleting all data in the database). The problem i have is that i use anonymous primary keys and the caches associated with the anonymous fields are not cleared. Would it be possible to had some mean of clearing these caches ? The problem is that at some time, i've got errors when inserting objects. I think that the key for the failing object is in cache but not in the database so when a foreign key references it, the insertion fails. Thanks, Guillaume Nodet - 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: JDO and OJB newbie Question
You will need CVS HEAD, correct -- also make sure you are comfy looking around the sources to see what is implemented and not. I have tried to throw OperationUnsupportedException("Not yet imeplemented!") when a feature isn't actually implemented yet =) This code is being actively written so it may be in states of flux at times as well, but I make sure all the unit tests pass before checking anything in. Also, you will need to either figure out the properties used to get ahold of the correct PersistenceManagerFactory, or just use the org.apache.ojb.jdo.PersistenceManagerFactoryImpl directly. I haven't spent any time making the discovery element work, nor testing the code Matt wrote -- it may or may not work. Let me know anything odd/etc you find, please! -Brian On Apr 14, 2004, at 9:51 AM, Charles N. Harvey III wrote: Brian, I _don't_ want to filter my queries. Can I give the native implementation a try? Would that be the CVS Head or would it be a different branch? Thanks. Charlie Brian McCallister wrote: You need both if you are using the JDORI plugin. It is annoying =( The native JDO impl I am working on for OJB will allow you to just use the OJB mappings as the .jdo files will only be used for (optional in OJB but not for spec-compliant JDO) bytecode enhancement process. This JDO impl is *far* from ready for use yet (well, actually it works great as long as you don't want to filter your queries as JDOQL isn't implemented yet). -Brian On Apr 14, 2004, at 8:06 AM, Nicolas Arni-Bloch wrote: Hi all, I want to try JDO with OJB but I have some misunderstood. I am not very clear about where to put the MetaData for the mapping ? In the repository.xml or in the XXX.jdo ? I look in the tutorial5 and I see that information for the mapping are stored in the Product.jdo. So should we put this information in the .jdo and in the repository.xml ? My second question is : with the JDO should we use the ManageableCollection interface for the collection or not. I have try the jdo implementation with a single class and its work. But I try with 1..n relation and it doesn't ? Is some body as code example for using JDO with OJB ? Nicolas - 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: JDO and OJB newbie Question
You need both if you are using the JDORI plugin. It is annoying =( The native JDO impl I am working on for OJB will allow you to just use the OJB mappings as the .jdo files will only be used for (optional in OJB but not for spec-compliant JDO) bytecode enhancement process. This JDO impl is *far* from ready for use yet (well, actually it works great as long as you don't want to filter your queries as JDOQL isn't implemented yet). -Brian On Apr 14, 2004, at 8:06 AM, Nicolas Arni-Bloch wrote: Hi all, I want to try JDO with OJB but I have some misunderstood. I am not very clear about where to put the MetaData for the mapping ? In the repository.xml or in the XXX.jdo ? I look in the tutorial5 and I see that information for the mapping are stored in the Product.jdo. So should we put this information in the .jdo and in the repository.xml ? My second question is : with the JDO should we use the ManageableCollection interface for the collection or not. I have try the jdo implementation with a single class and its work. But I try with 1..n relation and it doesn't ? Is some body as code example for using JDO with OJB ? Nicolas - 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: Newbie Question : OTM or ODMG
Ah, I missed the checkin message on that! Thank you! -Brian On Apr 13, 2004, at 5:20 PM, Oleg Nitz wrote: On Tuesday 13 April 2004 15:17, Brian McCallister wrote: Huh, the ODMG slower thing is interesting as Armin just reemed us all out for letting the OTM get so much slower than ODMG ;-) Have I missed something? Are there any new performance tests? Armin emailed the -dev list a few days back =) When I tested last time, OTM was somewhat faster. Of course, when you use OTM PB-style Criteria/Queries instead of ODMG-style OQLQueries, the difference would be more noticeable. But don't forget that OTM provides true ACID transactions, pessimistic and optimistic locking strategies (automatic upgrading of read lock to write lock for modified objects) and some other nice features like automatic storing of object modifications (for modified objects only), automatic creation/deletion of otm-dependent objects, long transactions support. So I guess OTM may be slower in some tests, especially when you run them against in-memory database like HSQL. but it is a little bit less than mature at the moment. It is definately in the unstable category for 1.0. Completely agree. Oleg is in the process of doing a major factoring job on parts of it to clean it up and fix a couple bugs (otm-dependent proxied collections not detecting deletes unless an explicit write lock is obtained on the parent is a particularly unpleasant one for me). The refactoring is now finished, and the bug that you mentioned is now fixed, at least according to my tests. Please re-run your tests. Many thanks to you and to all who try OTM, test OTM and report bugs! ;-) Regards, Oleg - 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: PhillyJUG OJB Slides
Glad I can help =) The sources etc (minus the jars) are posted as well, url is on a slide toward the end. -Brian On Apr 13, 2004, at 7:28 PM, C Qualset wrote: Thanks very much for posting the slides. It is a great place for a newbie like me to start. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ODMG API Question
Odd. Some notes... Task.getClass().getName() works better as Class#toString isn't the class name =( Do you not get ANY objects back, or do you get a different object back form the query? Is the foreign key a primitive type by chance? -Brian On Apr 13, 2004, at 8:20 PM, Wil Hunt wrote: Hey guys, I'm having a problem with regard to OJB-managed objects and their visibility. Here's the scenario: 1) Create a new object: Task task = new Task(...); Transaction tx = _odmg.newTransaction(); tx.begin(); tx.lock(task, Transaction.WRITE); tx.commit(); Note: task is saved (successfully) with a foreign key X. If I check the database.. the object is there. Good. 2) Query ODMG: select tasks from Task.getClass() where fkeyname = X This request does not return the above mentioned objects. If I restart my server (thus restarting OJB) then the objects show up in further queries. am I missing something obvious? Any assistance would be greatly appreciated. Thanks! Wil - 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: Newbie Question : OTM or ODMG
Huh, the ODMG slower thing is interesting as Armin just reemed us all out for letting the OTM get so much slower than ODMG ;-) Right now there are a couple hidden nasties in the OTM -- I like the OTM a lot (if just so that I can do a query by identity without casting to a TransactionImpl) but it is a little bit less than mature at the moment. It is definately in the unstable category for 1.0. Oleg is in the process of doing a major factoring job on parts of it to clean it up and fix a couple bugs (otm-dependent proxied collections not detecting deletes unless an explicit write lock is obtained on the parent is a particularly unpleasant one for me). I will personally still be using OTM for my development, but we just switched from OTM to ODMG for major app in development where I work because of the relative maturity of the chunks of code. I hope to switch back to OTM in the not-too-distant future (or to JDO as it is shaping up to be a very thin wrapper around the OTM, and it isn't really a bad API from the client side, don't get me started on javax.jdo.spi though ;-) Providing a facade to swap between ODMG and OTM is pretty straightforward as the OTM can handle OQL style queries. -Brian On Apr 13, 2004, at 6:46 AM, Daniel Perry wrote: From my experience of using both (i ended up doing an ODMG -> OTM conversion!): Note that i dont any of the more complicated stuff - just storing object trees, collections, etc, and querying the database. Also i dont use locking atall (one thing odmg does better i believe). Go with OTM. ODMG uses ODMG queries (sql like queries for selecting objects). OTM use a criteria classes for querying. I find OTM to be simpler, but more code intensive. ODMG is slower - Ditching ODMG and moving to OTM speeded up our app by about 5x! Doing complex (nested to several degrees "a.b.c...") in OTM works - i never got it working in ODMG. Daniel. -Original Message- From: Jean-Francois Beaulac [mailto:[EMAIL PROTECTED] Sent: 07 April 2004 17:03 To: [EMAIL PROTECTED] Subject: Newbie Question : OTM or ODMG Hi , i'm a real OJB newbie and I wonder which API should I use, i searched the mailing list and read the entire documentation on the website (i didnt read the entire JavaDoc of course) but i wasn't able to find a great comparison between the two APIs. It would be very usefull to me if somebody could post the main differences between both APIs Thanks Jean-Francois Beaulac trainee programmer @ www.beetext.com - 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: Any one using PostgreSQL and OJB ?
Postgres users: Has anyone ever gotten the master/slave replication to actually work? -Brian On Apr 2, 2004, at 12:15 PM, Antonio Gallardo wrote: Robert S. Sfeir dijo: Leandro Rodrigo Saad Cruz wrote: I am. no problems. Ditto, no issues, use it for almost all my projects unless client can pay for Oracle :-) Yep. PostgreSQL is my prefered choice too, even if the client can pay for Oracle or anything else. ;-) Best Regards, Antonio Gallardo - 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: Newbie (almost) at a standstill
On Apr 2, 2004, at 9:23 AM, [EMAIL PROTECTED] wrote: Thank you all for your pointers. I am well aware of the difficulty of writing good documentatioin when you are an expert in the field; sometimes ignorance is a blessing. I shall continue to report omissions or ambiguities as I find them. Much appreciated! Surely I should not need a transaction until I actually execute the query? Correct, must have been looking at your code too early in the morning =) Both count(*) and 'as' are in the OQL grammar I downloaded from ODMG.org yesterday. The one is in 'aggregateExpr', the other in 'projection'. If, as you say, the selection list (projectionAttributes in the grammar) is merely a placeholder, then the aggregate functions of the grammar can never be evaluated. Surely this was not the intention of the ODMG? Hmm I don't know about this -- I am far from an ODMG expert, I don't use that API often, and have never delved into that part of the code =( (nudge Thomas) -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Searching in a class hierachy (ODMG) (Nudging Armin)
Ah, thank you for posting the mappings. Will need to nudge Armin on this, I haven't used joins to map extents before =( -Brian On Apr 2, 2004, at 5:41 AM, Keith Rogers wrote: Could you clarify what you mean by that? Here is the relevent part of the config file: [EMAIL PROTECTED] 04/01/04 06:42PM >>> Does the table OJBStudent is mapped to have the column? OJB is smart about only querying on tables that define attributes across extents. How are these classes mapped and what does the schema look like? -Brian On Apr 1, 2004, at 10:00 AM, Keith Rogers wrote: I have a hierachy of classes that goes like this: user->person->student the user has a property called userStatus, which is a reference to another table. What I'm trying to do is get a list of students with a particular userStatus When I do the query for users like this: select ojbs from com.mp.hato.OJBUser where userStatus=1 It works fine. However, when I try select ojbs from com.mp.hato.OJBStudent where userStatus=1 I get a message java.sql.SQLException: Column not found, message from server: "Unknown column 'userStatus' in 'where clause'" Why is this happening when I use the student class, but not the user class? As far as I can tell, apart from this the inheritance has worked fine - if I retreived a student object I can access all the inherited fields, including the userStatus. So, I think its a problem with the query rather than the inheritance setup. Does anyone have any ideas? The information in this e-mail is confidential and intended to be solely for the use of the addressee(s) and may contain copyright and/or legally privileged information. If you are not the addressee (or responsible for delivery of the message to the addressee) please e-mail us at [EMAIL PROTECTED] and delete the message from your computer; copying, distribution, use or disclosure of its contents is strictly prohibited. As Internet communications are capable of data corruption no responsibility is accepted for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice contained in any e-mail without obtaining written confirmation of it. In addition, no liability or responsibility is accepted for viruses and it is your responsibility to scan attachments (if any). Please note that for business purposes, outgoing and incoming emails from and to the company may be monitored and recorded. Mouchel Parkman UK Ltd, Registered in England at West Hall, Parvis Road, West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040 - 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] The information in this e-mail is confidential and intended to be solely for the use of the addressee(s) and may contain copyright and/or legally privileged information. If you are not the addressee (or responsible for delivery of the message to the addressee) please e-mail us at [EMAIL PROTECTED] and delete the message from your computer; copying, distribution, use or disclosure of its contents is strictly prohibited. As Internet communications are capable of data corruption no responsibility is accepted for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice contained in any e-mail without obtaining written confirmation of it. In addition, no liability or responsibility is accepted for viruses and it is your responsibility to scan attachments (if any). Please note that for business purposes, outgoing and incoming emails from and to the company may be monitored and recorded. Mouchel Parkman UK Ltd, Registered in England at West Hall, Parvis Road, West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040 - 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: Newbie (almost) at a standstill
Any chance you could sum up what needs improvement in the docs? As Thomas put it when I first got involved with OJB, once you get really close to it, it can be hard to see it from a newcomers perspective =( There is a *lot* to it. I am personally invested in trying to make it easy for people to get started with OJB (I did the getting started, ojb-blank, and the new tutorials -- if they are deficient it is my fault, so I appreciate any help in fixing em up =) On ODMG: I don't think count(*) is supported (anyone know about this? I don't use ODMG much)). Last I used ODMG count, upper, etc weren't in it (using the ODMG published grammar for OQL). "as" isn't an OQL keyword. The "foo" in "select foo from bar" is pretty much a placeholder that doesn't do anything, to my (limited) knowledge of the ODMG OQL spec. In this case "foo" is just a label. What is returned is specificed by the "from classname" section. Looking at your test case, the NPE's are likely being caused by the fact that you don't have a transaction in progress. The ODMG api requires all queries etc be executed within the context of a transaction: To take some code from the ODMG tutorial: public static Product findProductByName(String name) throws Exception { Implementation impl = OJB.getInstance(); Transaction tx = impl.newTransaction(); tx.begin(); OQLQuery query = impl.newOQLQuery(); query.create("select products from " + Product.class.getName() + " where name = $1"); query.bind(name); DList results = (DList) query.execute(); Product product = (Product) results.iterator().next(); tx.commit(); return product; } Additionally, you need to include the full classname, including package, in the OQL string. I don't know if your Entity class is in the top level namespace, or in the same as the unit test, so I don't know if this is part of what is happening or not. -Brian On Apr 2, 2004, at 8:02 AM, [EMAIL PROTECTED] wrote: So, apart from one glitch I think that the other points are matters of clearer documentation. It is not clear from the Getting Started doc just what one has to do and in what order. There are also inconsistencies betwen the default build.properties and *.profiles as towhich variables are required. Some tidying up is what it comes down to. I am just left with my ODMG problem. BTW for those who are a bit irritated by my not snipping out the older, and now irrelvant, parts of this message stream, I am working with Lotus Notes, and if I try to edit the message it just deletes the whole lot. |-+-> | | "Brian McCallister" | | | <[EMAIL PROTECTED]| | | ompany.com> | | | | | | | | | 02-Apr-2004 13:10 | | | Please respond to "OJB| | | Users List" | | | <[EMAIL PROTECTED]| | | g>| | | | |-+-> -- ---| | | | | | | | To: "OJB Users List" <[EMAIL PROTECTED]> | | | | cc: | | Subject: Re: Newbie (almost) at a standstill | -- ---| repository.xml wasn't copied in rc5, was a problem, has been fixed in rc6. If you want to patch manually, change the ant copy in build.xml to copy respositor*.xml instead of repository_*.xml =) DB profiles are not copied on purpose, you need to copy the relevant settings into build.properties yourself. The build.properties contains all of the variables -- including jcdAlias and jdbcRuntimeDriv
Re: Newbie (almost) at a standstill
| | | 30-Mar-2004 11:18| | | Please respond to| | | "OJB Users List" | | | <[EMAIL PROTECTED]| | | he.org> | | || |-+> -- ---| | | | | | | | To: "OJB Users List" <[EMAIL PROTECTED]> | | | | cc: | | Subject: Re: Newbie at a standstill | -- ---| Hi Raphael, from your stack trace I can see you manipulate many of the default jdbc settings: Caused by: org.apache.ojb.broker.accesslayer.LookupException: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED] jcd-alias=BETConnection default-connection=true dbms=oracle jdbc-level=2.0 driver=oracle.jdbc.driver.OracleDriver protocol=jdbc sub-protocol=oracle:thin [EMAIL PROTECTED]:1521:TOOLS user=bet password=* eager-release=true only set true in JBoss <3.2.2 (but recommended to use 3.2.2 or higher) ConnectionPoolDescriptor={whenExhaustedAction=2, validationQuery=a query, OJB try to perform a validation query "a query", this will fail (not SQL compatible ;-)). Maybe this is the problem you have. maxIdle=2, maxActive=1, maxWait=3, removeAbandoned=true, numTestsPerEvictionRun=5, testWhileIdle=true, minEvictableIdleTimeMillis=4, testOnReturn=true, logAbandoned=true, removeAbandonedTimeout=8, timeBetweenEvictionRunsMillis=6, testOnBorrow=true} again, I recommend to use default settings first and only change settings step by step. batchMode=true I recommend to set batch-mode false to avoid side-effects. You can try to enable it when all stuff is working fine. useAutoCommit=AUTO_COMMIT_IGNORE_STATE Again default is '1', you set '0'. But in managed enviroments you need to set '0'. Do you try to run OJB in a managed environment? This wouldn't be a good starting point for a newbie ;-) ahh, now I see in your repository_database.xml what you have done. You picked up a jdbc-connection-descriptor used for junit testing and set you DB properties. This will not work, because the used properties don't be valid. Did you see http://db.apache.org/ojb/getting-started.html http://db.apache.org/ojb/platforms.html As Brian said before, recommended to use this way first to setup your environment. In build.properties you can set your DB. In the profiles directory you can find "templates" for all supported databases. Pick the oracle file and set your properties. regards, Armin ignoreAutoCommitExceptions=true [EMAIL PROTECTED] wrote: I have done the 'ant build' and it makes no difference. If in the db.open () I change to the "default" db alias the system appears not to see my parameters at all. It has username and password set to null. There is clearly something terribly obvious that I am just not understanding about setting up OJB. [org.apache.ojb.odmg.DatabaseImpl] ERROR: Open database failed: Borrow broker from pool failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, user=null, password=null Borrow broker from pool failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, user=null, password=null org.apache.ojb.broker.PBFactoryException: Borrow broker from pool failed, using PBKey org.apache.ojb.broker.PBKey: jcdAlias=default, user=null, password=null at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPe rsistenceBroker(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker( Unknown Source) at org.apache.ojb.odmg.DatabaseImpl.open(Unknown Source) at com.gsk.bet.ConnectionTest.setUp(ConnectionTest.java:33) As a background, I should explain that I am reasonably familiar with Torque. I am in the process of evaluating whether to go with OJB, which seems on paper to h
Re: Any one using PostgreSQL and OJB ?
Yep, almost exclusively. -Brian On Apr 2, 2004, at 4:01 AM, Andreas Bohnert wrote: yes, we do. no problems so far... regards andreas Martin I. Levi wrote: Hello people! Is there anybody using OJB on a PostgreSQL database? Please let me know. Greets, Martin Ivan Levi Universitat Politecnica de Catalunya Centre Tecnologic de Transferencia de Calor - 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: Searching in a class hierachy (ODMG)
Does the table OJBStudent is mapped to have the column? OJB is smart about only querying on tables that define attributes across extents. How are these classes mapped and what does the schema look like? -Brian On Apr 1, 2004, at 10:00 AM, Keith Rogers wrote: I have a hierachy of classes that goes like this: user->person->student the user has a property called userStatus, which is a reference to another table. What I'm trying to do is get a list of students with a particular userStatus When I do the query for users like this: select ojbs from com.mp.hato.OJBUser where userStatus=1 It works fine. However, when I try select ojbs from com.mp.hato.OJBStudent where userStatus=1 I get a message java.sql.SQLException: Column not found, message from server: "Unknown column 'userStatus' in 'where clause'" Why is this happening when I use the student class, but not the user class? As far as I can tell, apart from this the inheritance has worked fine - if I retreived a student object I can access all the inherited fields, including the userStatus. So, I think its a problem with the query rather than the inheritance setup. Does anyone have any ideas? The information in this e-mail is confidential and intended to be solely for the use of the addressee(s) and may contain copyright and/or legally privileged information. If you are not the addressee (or responsible for delivery of the message to the addressee) please e-mail us at [EMAIL PROTECTED] and delete the message from your computer; copying, distribution, use or disclosure of its contents is strictly prohibited. As Internet communications are capable of data corruption no responsibility is accepted for changes made to this message after it was sent. For this reason it may be inappropriate to rely on advice contained in any e-mail without obtaining written confirmation of it. In addition, no liability or responsibility is accepted for viruses and it is your responsibility to scan attachments (if any). Please note that for business purposes, outgoing and incoming emails from and to the company may be monitored and recorded. Mouchel Parkman UK Ltd, Registered in England at West Hall, Parvis Road, West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040 - 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]
PhillyJUG OJB Slides
A few people expressed interest in the slides from my PhillyJUG OJB presentation last night, so I have put them online at http://kasparov.skife.org/ojb-phillyjug.pdf -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie at a standstill
Are you using the ant build? The ojb-blank project template does a property replace in the build -- the required database information is in the build.properties and is copied into the generated repository_database.xml that goes in build/ when compilation is run. -Brian On Mar 29, 2004, at 11:24 AM, [EMAIL PROTECTED] wrote: I am trying to get OJB working and am getting absolutely nowhere, so I appeal to the list for some help. The environment is OJB rc5, Eclipse IDE, Sun JDK1.4.2, Oracle 9, NT4.0. The running of the code is controlled by JUnit. I can connect to the DB both with sqlplus and jdbc. I cannot actually get OJB to connect. Clearly I am missing something, but I cannot discover what. By fiddling around with the XML I can generate various sorts of errors. In all cases the url that the system is using appears to be entirely palusible. Here are the code, the repository_database.xml and the output: Code: /* * Created on 26-Mar-2004 * CVS version $Header:$ */ package com.gsk.bet; import java.util.*; import java.sql.*; import junit.framework.*; import org.apache.ojb.broker.*; import org.apache.ojb.broker.query.*; import org.odmg.*; import org.apache.ojb.odmg.*; import com.gsk.bet.Entity; /** * @author rxm1676 * @company GSK */ public class ConnectionTest extends TestCase { PersistenceBroker broker; Database db = null; Implementation odmg = null; public void setUp() { try { Class c = Class.forName("oracle.jdbc.driver.OracleDriver" ); broker = PersistenceBrokerFactory.defaultPersistenceBroker(); odmg = OJB.getInstance(); db = odmg.newDatabase(); db.open("BETConnection", Database.OPEN_READ_WRITE); } catch (Exception ex) { System.out.println(ex); } } public void tearDown() { if (broker != null) { broker.close(); } if (db != null) { try { db.close(); } catch (ODMGException ex2) { } } } /** * Null test. Just checks that OJB is properly installed, that it can see both the * XML and the bean classes, and that we can get a Broker and an ODMG instance. * */ public void testConnection() { } /** * Ensure that we can actually talk to the DB from this machine * */ public void testRawJDBC() { try { Connection con = DriverManager.getConnection ("jdbc:oracle:thin:@ukt01368.ggr.co.uk:1521:TOOLS", "bet", ""); PreparedStatement sth = con.prepareStatement("select * from entity where betid<10"); ResultSet res = sth.executeQuery(); System.out.println("Excuted raw query"); while (res.next()) { Entity ent = new Entity(); ent.setBetid(res.getInt("BETID")); ent.setEntityType(res.getString("ENTITYTYPE")); ent.setDescriptor(res.getString("DESCRIPTOR")); System.out.println("raw retrieval of "+ent); } res.close(); con.close(); } catch (Exception e) { System.out.println("Caught raw exception " + e); } } /** * * @author rxm1676 * @company GSK */ public void testODMGFetchSingle() { Transaction tx = odmg.newTransaction(); try { OQLQuery query = odmg.newOQLQuery(); query.create( "select betid, entityType, descriptor from " + Entity.class.getName() + " where betid = 1"); DList results = (DList)query.execute(); for (Iterator iter = results.iterator(); iter.hasNext();) { tx.begin(); Entity res = (Entity)iter.next(); System.out.println("Retrieved " + res); tx.commit(); } } catch (QueryInvalidException qie) { System.out.println(qie); tx.abort(); } catch (QueryException qe) { System.out.println(qe); tx.abort(); } } /** * Retrieve a single object using the PersistenceBroker * @author rxm1676 * @company GSK */ public void testPBFetchSingle() { Entity example = new Entity(); example.setBetid(1); Query q = QueryFactory.newQueryByExample(example); Entity res = (Entity)broker.getObjectByQuery(q); System.out.println("PB fetched "+res); } } Database_repopsitory.xml ="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl"> ="false"/> ="1"/>
Re: OQL Query by date
On Mar 26, 2004, at 9:15 AM, Angus Berry wrote: Thanks... for the record then 'date' was a bad name for a class attribute to be persisted in OQL? Yes, unfortunately. Blame ODMG though, not us please ;-) -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OQL Query by date
Here is the problem: from src/java/org/apache/ojb/odmg/oql/OQLLexerTokenTypes.txt LITERAL_date="date"=61 the word "date" is a token in OQL =( -Brian On Mar 25, 2004, at 5:00 PM, Angus Berry wrote: (rc5) From everything I've read I think this should work. I'm trying to select an object by it's id & date: query.create("select invoice from " + InvoiceBO.class.getName() + " where invoiceID = $1 and date = $2"); Before I even get to bind the query values (query.bind(invNum)), I get an error saying: line 1: unexpected token: and The following select also fails: query.create("select invoice from " + InvoiceBO.class.getName() + " where date = $1"); line 1: unexpected token: date However, if I use a line like the one below it will select OK (given the correct params): query.create("select invoice from " + InvoiceBO.class.getName() + " where invoiceID = $1 and clientName = $2"); Have done a bad thing by have a property called 'date' in my class, or is my syntax incorrect for a date select. thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB with Spring
I have played with OJB and Spring a couple times, but never for a major app. Using OJB in Spring is no problem. If you want to use Spring's unified transaction system, OJB does not presently have hooks directly into it. I have talked (over a couple beers) with Thomas Risberg, who wrote most of the JDBC DAO stuff in Spring, about providing an OJB template (whatever that is) for Spring and the other hooks to make it more seemless and IoC'd -- just have never had sufficient itch to really do it. Juergen has indicated that adding OJB support into Spring's distro would be great, so there is nothing blocking a level of integration like what iBatis, Hibernate, etc have -- just no one has felt like doing it yet. If you want to do integrate it more transparently into Spring I will happily contribute to that effort, though I don't have the time required to really spearhead the task right now. I expect that I will get a lot of nudges next Tuesday when I present (with Thomas Risberg) on OJB and Spring at a JUG meeting though. -Brian On Mar 24, 2004, at 8:00 AM, Robert S. Sfeir wrote: Has anyone successfully implemented OJB with the Spring framework, and can you tell me if you found that experience excruciatingly painful, easy, or what ever, and if found the results satisfactory? I am considering a switch to Spring, but Hibernate is of no interest to me, and I would much rather not make the switch without OJB. Thanks R - 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: Object not PersistenceCapable error
This usually happens if you are running against a class file (bytecode) that was not enhanced via the JDO bytecode enhancer. I suspect that the enhancer wasn't run, or there is a problem in the .jdo files for that class. -Brian On Mar 23, 2004, at 10:01 AM, Philippe Guillard wrote: I've got a JDOUserException/Object not PersistenceCapable error, Can somebody tell me in which direction i should look for my error? I only copied and adapt a working class to another one for another DB table. So the repository.xml is there, don't have enhanced class problems since i use JDO 1.0.1 for these both 2 new classes, they also look similar in terms of column types used, don't need to give the path cause it is in same directory and i use inside cocoon.(i use cocoon with mysql, sun JDO 1.0.1) Thanks for help. Phil - 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: soft-deleting objects
If you have a "deleted" style flag in the database for the soft delete you can probably accomplish this via a query customizer. If you mean to not flag the delete in the database at all, but only treat it as such in the application -- that is a bit trickier, but can probably be done via pb callbacks/row readers. -Brian On Mar 23, 2004, at 6:21 AM, Tino Schöllhorn wrote: Hi, I want to implement something like a soft-delete: Objects should be marked as "deleted" in its corresponing table and OJB should just ignore them when it is materializing or querying them. Where would be the best point to start when I want to implement this feature? I just played around with the RowReader-Concept - but I have the feeling that this is not the right place to start, because I think I have to modify the queries OJB is submitting to the database. Any ideas? Regards Tino - 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: JDO status for OJB 1.0 RC5
The OJB native JDO is both incomplete and undocumented. The backend necessary to support JDO is in place (via the OTM) but I think there just hasn't been enough demand for full JDO support, yet. It is my personal goal to get a solid implementation into 1.1, but for 1.0 the JDORI plugin is the only real JDO option. It works pretty well from what I hear, but I have only fiddled with it and not built any large apps with it. The biggest thing to do if you want to lessen the need for changes when native JDO is available in OJB is probably to use the OTM directly. You can also always help implement the JDO API on top of OJB ;-) -Brian On Mar 18, 2004, at 8:37 AM, Angus Berry wrote: I wonder if some could give me a little more in depth status of JDO in RC5. Specifically, from looking at the mail archives I understand that in addition to the JDO ref. mask, there is some native JDO already implemented. So I'm wondering if what's available is buggy or just incomplete and is this documented anywhere other than looking through the source. My reason being is I have a facade pattern to OJB as my ORM, but I was hoping to use as much JDO as possible to lessen the change when it becomes fully available. thanks - 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: Getting started
Balza -- the Quick Start isn't linked on pupose, the getting started is designed to replace it =) Did you find information on quick start you needed which wasn't available from the present getting started tutorial? -Brian On Mar 17, 2004, at 10:56 AM, balza wrote: Thank you for the answers. I've seen a recent post on this argument in the Mail archives (post:"Installation of OJB"). OJB is a very flexyble framework, but for a newbie this choice shoud be imbaracing. OJB should provide a "Default" and documented solution and a complex or "non Default" implementation at user choice. What do you think? While I'm searching for information, I've noted a problem (?) in the documentation: The "Getting Started" area is logically related to "Quick start" (http://db.apache.org/ojb/quickstart.html) but does not point to it. The "Quick start" area seems unreachable, I don't know how to get there from home page. Thank you Unfortunately I don't think there is one. I hit this issue when I started with ojb. There's a strong case both for and against having an ant task that just creates the OJB system table schemas. On the "for" side it would make it easy to dump the basic schemas you may into your database without all the test tables you currently get. On the against side: You don't always need OJB system tables. If you setup your primary key generation (auto-increment) to use database sequences, then (as far as I know) you only need OJB system tables for certain features such as the ODMG api. Because everyone's usage of these tables is different, what system tables would you include? Personally, I'd like to see an ant task that generates all the OJB system tables you may need and then you could just choose to not use them later once you've started to understand what's going on. That approach seems to provide the easiest learning curve for somebody new to OJB. So to answer your question what I use is: 1) database sequences for auto-increment http://db.apache.org/ojb/howto-use-db-sequences.html 2) No OJB system tables at all. -Original Message- From: balza [mailto:[EMAIL PROTECTED] Sent: 16 March 2004 15:09 To: ojb-user Subject: Getting started Hello, what is the ant task to run to create only OJB system table (OJB_*) with OJB RC5? I've run ojb-blank task but has created a lot of table. thanks - 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: Getting started
There is a workaround, btw: Thomas D added the ability (I haven't used it) to create and execute DDL from a persistence broker by giving it a torque schema. ojb-blank includes the torque schema for the system tables in src/schema/ If you add the schema file to the classpath you can: TorqueDBHandling torque = new TorqueDBHandling(); PBKey key = PersistenceBrokerFactory.getDefaultKey(); torque.setConnection(MetadataManager.getInstance().connectionRepository( ).getDescriptor(key)); InputStream in = Thread.contextClassLoader().getResourceAsStream("ojbcore-schema.xml"); torque.addDBDefinitionFile(in); // torque.createDB(); torque.initDB(); Or something like that =) On Mar 17, 2004, at 8:22 AM, Brendan Richards wrote: Unfortunately I don't think there is one. I hit this issue when I started with ojb. There's a strong case both for and against having an ant task that just creates the OJB system table schemas. On the "for" side it would make it easy to dump the basic schemas you may into your database without all the test tables you currently get. On the against side: You don't always need OJB system tables. If you setup your primary key generation (auto-increment) to use database sequences, then (as far as I know) you only need OJB system tables for certain features such as the ODMG api. Because everyone's usage of these tables is different, what system tables would you include? Personally, I'd like to see an ant task that generates all the OJB system tables you may need and then you could just choose to not use them later once you've started to understand what's going on. That approach seems to provide the easiest learning curve for somebody new to OJB. So to answer your question what I use is: 1) database sequences for auto-increment http://db.apache.org/ojb/howto-use-db-sequences.html 2) No OJB system tables at all. -Original Message- From: balza [mailto:[EMAIL PROTECTED] Sent: 16 March 2004 15:09 To: ojb-user Subject: Getting started Hello, what is the ant task to run to create only OJB system table (OJB_*) with OJB RC5? I've run ojb-blank task but has created a lot of table. thanks - 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: Most Stable OJB version
I expect an RC6 to be cut from cvs head as soon as I get around to verifying the ASL 2.0 stuff is all in place correctly. Assuming there are no major bugs in it, I believe the plan is to take RC6 to the pmc for a release vote in a week or two, and assuming the vote goes alright (no reason to expect otherwise) RC6 will be branched as 1.0. RC5 is good, CVS HEAD is better as a couple bugs came up in RC5, I plan on finishing the ASL 2.0 stuff tuesday night, so we could theoretically push RC6 this week and hopefully only have 1.0 three months after our self-imposed deadline ;-) -Brian On Mar 15, 2004, at 6:24 AM, Antonio Gallardo wrote: Chris Lewington dijo: Hi all, I'm planning to upgrade from version 0.9.7 (yes, I know that is rather old but with some tweaking it has mostly worked for us). Can anyone suggest the best upgrade? Obviously the CVS head is the most up to date, but is rc4 or rc5 a better bet for stability right now? I think the best stable is the CVS HEAD. Soon will be the 1.0 release. Best Regards, Antonio Gallardo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB performance tip
Thank you! -Brian On Mar 15, 2004, at 9:05 AM, Edson Carlos Ericksson Richter wrote: Hi! Just to share with you all our latest experiences about performance. After three days working on OJB performance optimization for our Swing app, I've achieved a formula that fits near all our cases (look, it may not fit your need). We are not using proxyies for everthing anymore. Today, all objects are not proxy, and references are not proxies too (99,9% of cases). Only collections (the ones you be absolutely right that will not always need data) will receive proxy="true". Example, a customer in 90% of the cases will need the addresses (1:N) reference, so we don't use proxy. At other side, we have a "per user" log feature, where we almost never ask for this info (only store new info there for future reference if needed), and in this case, we use proxy. To solve the cyclic references, we working with PerBroker cache, that works fine for this purpose. rc5 is stable and fast (the only problems I've detected is that it tries to get PersistentField even if auto-update='false', and the toString in proxies - but this is subject for other threads). Starting the app with -Xmx128m we are able to materialize about 3 really complex objects in simple machines (800MHz-1Ghz) in less than 10 seconds (that is good to my point of view). To debug and fine tune, I'm using the p6spy and the Jahia SQL Profiler (that's incredible simple to configure OJB to use this two excellent products). Thanks to all people that always supported us in this year of research (Thomas, Armin, Jakob - by your patience - along others, need special thanks). We still have a lot of work, and from time-to-time I'll be sharing more info and knoledge with this amazing team. Richter --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.620 / Virus Database: 399 - Release Date: 11/3/2004 - 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]