limit query
Hi, how can i limit the result in OJB. Smail Louahchi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: limit query
Take a look at these methods, they should be usefull for you : org.apache.ojb.broker.query.Query.setEndAtIndex() org.apache.ojb.broker.query.Query.setStartAtIndex() Thomas At 04:17 01/09/2003, you wrote: Hi, how can i limit the result in OJB. Smail Louahchi - 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: updating using SQL ansi & udfs
Why should you use sql when OJB handles the situation without any problem? http://db.apache.org/ojb/tutorial1.html scroll down to "Updating Objects". Regards Roland Carlsson - Original Message - From: "Jason Pyeron" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Sunday, August 31, 2003 10:31 PM Subject: updating using SQL ansi & udfs > To the list: > > If I could do a SQL update of the like: > > UPDATE table_name SET date_col=NOW() WHERE id=###; > > How should this be done under OJB? > > > Sincerely, > > Jason Pyeron > > -- > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > - - > - Jason Pyeron http://www.pyerotechnics.com - > - Partner & Sr. Manager Pyerotechnics Development, Inc. - > - 500 West University Parkway #1S - > - +1 (410) 808-6646 Baltimore, Maryland 21210-3253 - > - - > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > > This message is for the designated recipient only and may contain > privileged, proprietary, or otherwise private information. If you > have received it in error, purge the message from your system and > notify the sender immediately. Any other use of the email by you > is prohibited. > > > > > - > 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]
Identity Problems.
Hiya! We've been using OJB for quite some time now, and had no problems , but recently the amount of people using it has increased and we get this error: "Could not init Identity for given object class x.form.CompanyPresentationBooking: Borrow broker from pool failed" I should tell you that the website running Tomcat shares the (mySQL) database with 2 or more directly connected Java Clients. My fellow developper has suggested a problem with the Sequence Manager. Maybe one of youz has encountered this message and knows where the problem is likely to be - if we restart the website (Tomcat) the problem dissappear for a bit but then returns after... Onno - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Identity Problems.
Hi Onno, seems like a PB leak or a to small PB-pool (OJB.properties maxActive=xxx, default was 100). If you set log-level for org...broker.PersistenceBrokerFactoryImpl to 'info', OJB prints a message when does create a new PB instance (rc4, earlier versions give it a try). If you have a PB-leak, make sure that after use all PB instances were closed (broker.close() call). > suggested a problem with the Sequence Manager. > which SequenceManager implementation do you use? regards, Armin - Original Message - From: "onno" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, September 01, 2003 12:55 PM Subject: Identity Problems. > Hiya! > > We've been using OJB for quite some time now, and had no problems , but > recently the amount of people using it has increased and we get this error: > > "Could not init Identity for given object class > x.form.CompanyPresentationBooking: Borrow broker from > pool failed" > > I should tell you that the website running Tomcat shares the (mySQL) > database with > 2 or more directly connected Java Clients. My fellow developper has > suggested a problem with the Sequence Manager. > > Maybe one of youz has encountered this message and knows where the problem > is likely to be - if we restart the website (Tomcat) the problem dissappear > for a bit but then returns after... > > Onno > > > > > - > 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: Identity Problems.
Armin Waibel wrote: If you have a PB-leak, make sure that after use all PB instances were closed (broker.close() call). Hi, I had the same problem/error message and sure enough there was a leak. I implemented a counter of instances each time I borrowed a connection and monitored that regularly using an extra thread ... it gave the clue With each borrow I always include finally{ releaseBroker(broker); } Which calls my own method to release it and update the counter. This ensures close even if an exception occurs. Never had any problems since (we have something like 20-30 concurrent users). Cheers, Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie ODMG-API problem
Hi everybody, after playing around with the PB-API for a while, I started trying the ODMG-API today. But I have some difficulties with the OQL and there aren't much information on the odmg.org site. :( I have two entries in my db-table, the BEN_IDs are "LAMBREC" and "AAA" but with the query below I still get both, no matter what I enter as benId in the query. What am I doing wrong? Another question that came up is the sense of the 'asdf' in the select query. What can it be used for? Here is what I do: Transaction tx = odmg.newTransaction(); tx.begin(); OQLQuery oQuery = odmg.newOQLQuery(); oQuery.create("select asdf from " + VproviZulBen.class.getName() + " where benId = LAMBREC"); List all = (List) oQuery.execute(); tx.commit(); The xml-def is: Table definition (just in case...): CREATE TABLE LSVERFT.TPROVI_ZUL_BEN (BEN_NR INTEGER NOT NULL, BEN_ID CHAR(8) NOT NULL ) Thanks a lot Lasse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Identity Problems.
Please, can you post the whole stack trace to make things clearer? Armin - Original Message - From: "Armin Waibel" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, September 01, 2003 3:14 PM Subject: Re: Identity Problems. > Hi Onno, > > seems like a PB leak or a to small PB-pool > (OJB.properties maxActive=xxx, default was 100). > > If you set log-level for org...broker.PersistenceBrokerFactoryImpl > to 'info', OJB prints a message when does create a new PB instance > (rc4, earlier versions give it a try). > If you have a PB-leak, make sure that after use all PB instances > were closed (broker.close() call). > > > suggested a problem with the Sequence Manager. > > > which SequenceManager implementation do you use? > > regards, > Armin > > - Original Message - > From: "onno" <[EMAIL PROTECTED]> > To: "OJB Users List" <[EMAIL PROTECTED]> > Sent: Monday, September 01, 2003 12:55 PM > Subject: Identity Problems. > > > > Hiya! > > > > We've been using OJB for quite some time now, and had no problems , > but > > recently the amount of people using it has increased and we get this > error: > > > > "Could not init Identity for given object class > > x.form.CompanyPresentationBooking: Borrow broker from > > pool failed" > > > > I should tell you that the website running Tomcat shares the (mySQL) > > database with > > 2 or more directly connected Java Clients. My fellow developper has > > suggested a problem with the Sequence Manager. > > > > Maybe one of youz has encountered this message and knows where the > problem > > is likely to be - if we restart the website (Tomcat) the problem > dissappear > > for a bit but then returns after... > > > > Onno > > > > > > > > > > - > > 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: Newbie ODMG-API problem
Hello Lasse, > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > I have two entries in my db-table, the BEN_IDs are "LAMBREC" and > "AAA" > but with the query below I still get both, no matter what I enter > as benId > in the query. What am I doing wrong? Have you tried to enclose LAMBREC in quotes? > Another question that came up is the sense of the 'asdf' in the > select > query. What can it be used for? In the OQL standard, it is used as a bound variable, i.e., it is a freely chosen identifier. Standard OQL allows to make use of it, for example: select asdf.spouse.name from Person as asfd where ... would select the names of the spouses of the matching persons. However, such syntax is not supported by OJB, so at the moment, that identifier is completely ignored. Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: limit query
thx, works great ;-) Smail Louahchi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie q.2: deployment ojb 1.0 rc3 with tomcat
Hi, another question: if I put the jar-files (db-ojb-1.0.rc3.jar et al) into my WEB-INF/lib, then my app never gets a broker when it tries to: mBroker = PersistenceBrokerFactory. defaultPersistenceBroker(); BUT if i put all the jars into $TOMCAT_HOME/common/lib, then it works (fairly well, in fact, an tomcat->reload application does not work, but this i can live with). Any help, thoughs, hints? thanks in advance, Raoul - in catalina.out I have mesgs like: Starting service Tomcat-Standalone Apache Tomcat/4.1.18 WebappClassLoader: validateJarFile(/opt/jakarta/tomcat/webapps/hello/WEB-INF/lib/j2ee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class 6631 [main] INFO http11.Http11Protocol - Starting Coyote HTTP/1.1 on port 8080 6678 [main] INFO common.ChannelSocket - JK2: ajp13 listening on /0.0.0.0:8009 6682 [main] INFO server.JkMain - Jk running ID=0 time=1/50 config=/opt/jakarta/tomcat/conf/jk2.properties 6688 [main] INFO http11.Http11Protocol - Starting Coyote HTTP/1.1 on port 8081 in performLogin: no db found, creating new.. in performLogin: creating new ok java.lang.VerifyError: Cannot inherit from final class at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:502) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1664) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:953) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1394) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.createContentDispatcher(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.(XMLDocumentFragmentScannerImpl.java:249) at org.apache.xerces.impl.XMLDocumentScannerImpl.(XMLDocumentScannerImpl.java:245) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.(Unknown Source) at org.apache.xerces.parsers.IntegratedParserConfiguration.createDocumentScanner(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.(DTDConfiguration.java:367) at org.apache.xerces.parsers.StandardParserConfiguration.(StandardParserConfiguration.java:198) at org.apache.xerces.parsers.IntegratedParserConfiguration.(Unknown Source) at org.apache.xerces.parsers.IntegratedParserConfiguration.(Unknown Source) ... -- Raoul Markus PGP key available from servers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with mapping
Ok, slightly odd thing I've got going here. I've got one table that has a list of products. These products can either be standalone products, and they can be add-on's for other products. So I've got a second table that just has 2 fields - product_id and parent_product_id that are referenced to the original product table. More than one product can have the same parent product? how would I map this out? any idea what I'm saying here? Thanks -Clay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with mapping
Hi! You can start reading at: http://www.mail-archive.com/[EMAIL PROTECTED]/msg03563.html I know I asked the same question a year ago and I wasn't the first one so make a couple of searches in the arcives. Good searchwords could be "recursive", parent-child". Regards Roland Carlsson - Original Message - From: "Clay Mitchell" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, September 01, 2003 9:53 PM Subject: Help with mapping > Ok, slightly odd thing I've got going here. > > I've got one table that has a list of products. These products can > either be standalone products, and they can be add-on's for other products. > > So I've got a second table that just has 2 fields - product_id and > parent_product_id that are referenced to the original product table. > More than one product can have the same parent product? > > how would I map this out? any idea what I'm saying here? > > Thanks > -Clay > > > > - > 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]
newbie q: Criteria for java.util.Date
Hi, I tried the following code, but this query didn't return any hits: public static Collection getSessionsOfDay(DBConnector pDbconnector,Date pDateHeld, String pUser) { ... tCrit.addEqualTo("DATE_HELD", pDateHeld); ... Query tQuery = new QueryByCriteria(SDBSession.class, tCrit); } and I had to replace it by the following (which works, but is no good): public static Collection getSessionsOfDay(DBConnector pDbconnector,Date pDateHeld, String pUser) { ... // TODO: this date operations are not nice... Calendar tCal = Calendar.getInstance(); tCal.setTime(pDateHeld); // make a string like "2003-8-29", which is recognized by mysql String tDateStr = "" + tCal.get(Calendar.YEAR) + "-" + (1+tCal.get(Calendar.MONTH)) + "-" + tCal.get(Calendar.DAY_OF_MONTH); tCrit.addEqualTo("DATE_HELD", tDateStr); ... Query tQuery = new QueryByCriteria(SDBSession.class, tCrit); in mysql (3.23.55-log), the column is defined as DATE and holds to my opinion only the day (not the time). the java.util.Date of course has the exact time, maybe this causes the null result? But with the tDateStr I am no longer independend of the db (i.e. which date strings it recognizes). any tips, thoughts? Thanks in advance. -- Raoul Markus PGP key available from servers - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: updating using SQL ansi & udfs
On Mon, 1 Sep 2003, Roland Carlsson wrote: > Why should you use sql when OJB handles the situation without any problem? > http://db.apache.org/ojb/tutorial1.html scroll down to "Updating Objects". > > From: "Jason Pyeron" <[EMAIL PROTECTED]> > Sent: Sunday, August 31, 2003 10:31 PM > > > UPDATE table_name SET date_col=NOW() WHERE id=###; > > > > How should this be done under OJB? my question was how can I use UDF's and other functions which the results are not able to be generated by the VM or any code running on it. IE: obj.setName("bob smith"); obj.setSpecialField(new SQLInline("MyUDF()")); does anyone even know how to do this through update-able result-sets? -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron http://www.pyerotechnics.com - - Partner & Sr. Manager Pyerotechnics Development, Inc. - - 500 West University Parkway #1S - - +1 (410) 808-6646 Baltimore, Maryland 21210-3253 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie q: Criteria for java.util.Date
Hi Raoul, Did u try to use java.sql.Date instead of java.util.Date?? I think this might solve your problem!! Cheers, Daniel Raoul Markus wrote: Hi, I tried the following code, but this query didn't return any hits: public static Collection getSessionsOfDay(DBConnector pDbconnector,Date pDateHeld, String pUser) { ... tCrit.addEqualTo("DATE_HELD", pDateHeld); ... Query tQuery = new QueryByCriteria(SDBSession.class, tCrit); } and I had to replace it by the following (which works, but is no good): public static Collection getSessionsOfDay(DBConnector pDbconnector,Date pDateHeld, String pUser) { ... // TODO: this date operations are not nice... Calendar tCal = Calendar.getInstance(); tCal.setTime(pDateHeld); // make a string like "2003-8-29", which is recognized by mysql String tDateStr = "" + tCal.get(Calendar.YEAR) + "-" + (1+tCal.get(Calendar.MONTH)) + "-" + tCal.get(Calendar.DAY_OF_MONTH); tCrit.addEqualTo("DATE_HELD", tDateStr); ... Query tQuery = new QueryByCriteria(SDBSession.class, tCrit); in mysql (3.23.55-log), the column is defined as DATE and holds to my opinion only the day (not the time). the java.util.Date of course has the exact time, maybe this causes the null result? But with the tDateStr I am no longer independend of the db (i.e. which date strings it recognizes). any tips, thoughts? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]