Using OJB RC6 in a Servlet Container
Hi With RC5 I had'nt any errors on deploying ojb in a Tomcat 4.1.29 Instance. Now I tryed to use RC6 an had always the following error. Can anyone tell me, what this means? I tryed to add or remove some jar-Files but I did'nt find out where the problem begins. I tried olso Tomcat 5.0.19 and had the same error. Also the ojb-servlet.war had the same error. Any hint? INFO: Error installing java.lang.IllegalArgumentException: javacc,ant,commons-collections,log4j,junit-Extension-Name at java.util.jar.Attributes$Name.init(Attributes.java:434) at java.util.jar.Attributes.getValue(Attributes.java:97) at org.apache.catalina.util.ManifestResource.getRequiredExtensions(ManifestReso urce.java:243) at org.apache.catalina.util.ManifestResource.processManifest(ManifestResource.j ava:212) at org.apache.catalina.util.ManifestResource.init(ManifestResource.java:96) at org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionVal idator.java:250) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4133) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:8 66) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.j ava:320) at org.apache.catalina.core.StandardHost.install(StandardHost.java:875) at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:927) at org.apache.catalina.manager.HTMLManagerServlet.deployInternal(HTMLManagerSer vlet.java:320) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.jav a:300) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:204) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:257) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext Valve.java:245) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:199) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:587) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :156) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:732) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:688) at java.lang.Thread.run(Thread.java:534) 28.04.2004 08:27:56 org.apache.catalina.core.StandardHostDeployer install INFO: Installing web application at context path /ojb-servlet from URL file:C:/Programme/Apache Software Foundation/Tomcat 5.0/webapps/ojb-servlet Roland Ribi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Clustered cache with OSCache JavaGroups
Solved! The problem was, as I commented in my post, a misconception about what a distributed cache really has to do. I thought even read changes had to be notified to the rest of the cluster, but after a deep reading and investigation of other managers of distributed cache, I realized that only updating changes are communicated through JGroups by OSCache. Thanks anyway for the support, Enrique Medina. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Thu, 22 Apr 2004 08:05:26 -0700 OK, I won't be able to exactly duplicate your environment since we don't have any windows computers here at the Open Source Lab, but I'll see what I can get. Shouldn't matter anyway, but it always seems too... Jason On Thu, 2004-04-22 at 00:10, Enrique Medina wrote: Websphere Server within WSAD 5.1 Windows 2000 Professional From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 12:45:45 -0700 Not really sure what the problem is here. I will attempt to set up some nodes here at the OSL over the next day or two and debug. What Web container/OS are you using? Jason On Wed, 2004-04-21 at 11:14, Enrique Medina wrote: Cache events are correct, but they are local. I mean, when the first instance caches an object, it is supposed to inform the other instance, through JavaGroups, but this communication doesn't happen. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 10:24:41 -0700 The debug output will show the cache events being handled such as read and gets from the cache. Jason On Wed, 2004-04-21 at 09:53, Enrique Medina wrote: What do you exactly want to log? What do you want me to show about the logging messages? From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 08:20:56 -0700 Can you add the a line to your/a log4j properties files that lowers the debug level? It would look like: log4j.category.com.opensymphony.oscache=DEBUG On Wed, 2004-04-21 at 07:58, Enrique Medina wrote: Hi, I have developed a web application with OJB, as the ORM for data access. But now, I want to use OJB in a clustered environment. I have read with attention the information provided at the web: http://db.apache.org/ojb/howto-work-with-clustering.html with respect to setting up OSCache to work with OJB in a cluster. I have strictly followed all the steps commented in this tutorial, and have made a little client test application to see the results. Everything seems to start perfectly, but no cache communication exists between two instances of this client test application at all! I am using OJB RC6 with latest version of OSCache JavaGroups deployed within OSCache distribution. I have a simple test application consisting of: 1 public static void main(String[] args) 2 { 3 // Obtain a connection through OJB broker. 4 PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); 5 6 // Create a new query by example that should return all clients. 7 Query query = QueryFactory.newQueryByExample(new ClientVO()); 8 Collection clients = broker.getCollectionByQuery(query); 9 10 // Ask again for the collection of clients. 11 Collection againClients = broker.getCollectionByQuery(query); 12 } I set a breakpoint on lines 8 and 11, just before obtaining the clients for the first time and for the second time. The sequence of steps I follow to see if two instances of the program communicate at cache level through JavaGroups are: 1) I run a first instance of this test application 1.1) The thread of execution gets stopped on line 4 (first instance). The JavaGroups logging says -- A new member at address '192.168.0.1:1590' has joined the cluster 2) Then I run a second instance of the application 2.1) The thread of execution gets stopped on line 4 (second instance). I see on the console how the first instance is notified that the second instance has joined the cluster (JavaGroups logging -- A new member at address
How-to model a composite design pattern of java in the database (and repository)!
Hello! I'm quiet new to ojb and maybe haven't read all possible materials about it. Excuse me if this is real newbie!! Problem: I have a library (university project) which has a COMPOSITE PATTERN (the one from gamma et'al) for implementing the storing of different types of objects (cds, books / catalogs and subcatalogs) generic. - 0..* has-a | InventoryEntry|-- |---| | | Operation() | | - | ?| || |i-as | | || | || | --- | | Item | | Catalog |--- --- |Operation() | | Operation() | ---| Add(InentoryEntry) | |Remove(InentoryEntry)| |-| |Collection i_entries | --- Item and Catalog have a is-a relationship with Inventory Entry! Catalog has a has-a relationship with Inventory Entry. Later in the implementation the Books and CDs should be derived from Item (for now it's sufficient to say a book or what ever is an instance of Item). So how to model this in the database and the repository with storing instances of item and Catalog to the same Collection (i_entries) in java. (I do this by now having a Items Collection and a Catalog Collection in the Catalog Class. but these two different Collections should be merged to one in java). Besides this: A Catalog can have null or many (sub)catalogs and a Catalog can have null or many Items. A Item can be in one or many (sub)Catalogs. -- so I'm not only building a simple tree structure with this pattern, rather a more complex structure with everything allowed than circular graphs (because of then occurring endless loops traversing the structure). Excuse my bad English, but I haven't sleeped that much last night! Thanks Georg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating Reports
Thanks to all who replied to this! All of these seem to be report presentation libraries rather than report generators, so I think I might try to write something more specific to my needs. Keith [EMAIL PROTECTED] 26/04/2004 14:30:28 A quick search of sourceforge finds: OpenReports : http://sourceforge.net/projects/oreports/ JasperReports : http://sourceforge.net/projects/jasperreports/ JFreeReport : http://sourceforge.net/projects/jfreereport/ I think all 3 of these tools use an xml based syntax. I have played around w/ then a little, but not enough to offer any advice. I don't think any integrate directly w/ OJB, but you could probably write a wrapper for the OJB Report Query class for use with the tools. Good luck. Keith Rogers wrote: I've gotten around to the part of my application that needs to produce reports on various things. Rather than hard-code reports, which would, admittedly make my job more secure :-) , I'd like to be able to write a definition of the report in XML, and have some parser take this and produce the report automatically on demand. I realise that this is not going to be a trivial task, so my first question is - Has anyone done anything similar for OJB? Assuming the answer is No, I suppose I'll have to try it myself... Does anyone know of a similar report-from-xml-definition that I might draw ideas from? Keith -- Robert r. Sanders Chief Technologist iPOV www.ipov.net - 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]
Re: Creating Reports
Keith, We´ve been using JasperReports with OJB por a while now. Reading your requirements, it seems JasperReports deservs a deep look. Let me quote you I'd like to be able to write a definition of the report in XML Well, this is exactly what you do with JR. Jasper will parser the report definition for you, will compile the report and will it have it ready to be filled which means run in JR jargon on demand. From JasperReports tutorial a simple report definition (http://jasperreports.sourceforge.net/tutorial/): ?xml version=1.0? !DOCTYPE jasperReport PUBLIC -//JasperReports//DTD Report Design//EN http://jasperreports.sourceforge.net/dtds/jasperreport.dtd; jasperReport name=name_of_the_report ... ... /jasperReport If you like to try a visual designer for JR try ireports at http://ireport.sourceforge.net/ JasperReports will work with any jdbc datasource and with OJB you will be able to pass him a collection of objects. BTW, we are no related to JR in any form. Regards, Gustavo. Keith Rogers [EMAIL PROTECTED] wrote on 28/04/2004 08:18:08 a.m.: Thanks to all who replied to this! All of these seem to be report presentation libraries rather than report generators, so I think I might try to write something more specific to my needs. Keith [EMAIL PROTECTED] 26/04/2004 14:30:28 A quick search of sourceforge finds: OpenReports : http://sourceforge.net/projects/oreports/ JasperReports : http://sourceforge.net/projects/jasperreports/ JFreeReport : http://sourceforge.net/projects/jfreereport/ I think all 3 of these tools use an xml based syntax. I have played around w/ then a little, but not enough to offer any advice. I don't think any integrate directly w/ OJB, but you could probably write a wrapper for the OJB Report Query class for use with the tools. Good luck. Keith Rogers wrote: I've gotten around to the part of my application that needs to produce reports on various things. Rather than hard-code reports, which would, admittedly make my job more secure :-) , I'd like to be able to write a definition of the report in XML, and have some parser take this and produce the report automatically on demand. I realise that this is not going to be a trivial task, so my first question is - Has anyone done anything similar for OJB? Assuming the answer is No, I suppose I'll have to try it myself... Does anyone know of a similar report-from-xml-definition that I might draw ideas from? Keith -- Robert r. Sanders Chief Technologist iPOV www.ipov.net - 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]
Poor man trying to log....
Hi, I would like to check OJBs logs but I really dont know how to configure them. I found that in OJB.properties there is a definition which reads: LoggerConfigFile=log4j.properties Can any one tell me which is this files format? The only thing Im sure is that I use PoorMansLoggerImpl and that this class logs using a simple System.out.println(), i wonder which out is this really because I dont see anything on my screen. :-) Is there any documentation about OJBs logging I can read? Help please! :-) 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]
reverse-Tool with Oracle 8.1.7
Hi I would like to use the reverse-tool to genereate the repository.xml and the java code. But the reverse-tool takes always DECIMAL (JDBC-Type) and Long (Java-Type) for any Number column in Oracle. How can I override this so that a NUMBER(4) Column is mapped from BIGINT (JDBC-Type) to Long (Java) and a Column with NUMBER(6,2) is mapped from DOUBLE (JDBC-Type) to Double (Java)? Does I need to do this manually or can I declare the mapping in the OJB.properties or does I need to customize a class of OJB and if yes which one or how? With the default behavior I get ClasCastExceptions when I try to get any row from the database. Roland Ribi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[JDO] Can I use a proxy with the JDO implementation ?
Hi, I would like tu use a proxy to manipulate my objects (wich contains BLOB). Is this use is possible with JDO ? Maybe with the org.apache.ojb.broker.VirtualProxy ? Thanks in advance, Alexandre. Excuse my bad English ;-). -- Alexandre BOISSEAU Université de Rennes1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Creating Reports
It did not look easy to produce the following report, The report details which units in a course a student has passed. The rows are students, the columns are units (and one for the student id). The problem here is that the unit columns are retreived from the course, so it will not be known at runtime how many there are or what their names are. I undestand that it is possible to programmatically adjust the report definition, but this would then require me to use two XML docs for each report - the JasperReport xml and another to define how this should be modified at runtime. My impression (which I hope is wrong) is still that JasperReports is mainly a report presentation tool, and that producing tabular reports like the one above that has variable fields produced by a query at filling time would be difficult to do using it. Keith [EMAIL PROTECTED] 28/04/2004 12:53:20 Keith, We ve been using JasperReports with OJB por a while now. Reading your requirements, it seems JasperReports deservs a deep look. Let me quote you I'd like to be able to write a definition of the report in XML Well, this is exactly what you do with JR. Jasper will parser the report definition for you, will compile the report and will it have it ready to be filled which means run in JR jargon on demand. From JasperReports tutorial a simple report definition (http://jasperreports.sourceforge.net/tutorial/): ?xml version=1.0? !DOCTYPE jasperReport PUBLIC -//JasperReports//DTD Report Design//EN http://jasperreports.sourceforge.net/dtds/jasperreport.dtd; jasperReport name=name_of_the_report ... ... /jasperReport If you like to try a visual designer for JR try ireports at http://ireport.sourceforge.net/ JasperReports will work with any jdbc datasource and with OJB you will be able to pass him a collection of objects. BTW, we are no related to JR in any form. Regards, Gustavo. Keith Rogers [EMAIL PROTECTED] wrote on 28/04/2004 08:18:08 a.m.: Thanks to all who replied to this! All of these seem to be report presentation libraries rather than report generators, so I think I might try to write something more specific to my needs. Keith [EMAIL PROTECTED] 26/04/2004 14:30:28 A quick search of sourceforge finds: OpenReports : http://sourceforge.net/projects/oreports/ JasperReports : http://sourceforge.net/projects/jasperreports/ JFreeReport : http://sourceforge.net/projects/jfreereport/ I think all 3 of these tools use an xml based syntax. I have played around w/ then a little, but not enough to offer any advice. I don't think any integrate directly w/ OJB, but you could probably write a wrapper for the OJB Report Query class for use with the tools. Good luck. Keith Rogers wrote: I've gotten around to the part of my application that needs to produce reports on various things. Rather than hard-code reports, which would, admittedly make my job more secure :-) , I'd like to be able to write a definition of the report in XML, and have some parser take this and produce the report automatically on demand. I realise that this is not going to be a trivial task, so my first question is - Has anyone done anything similar for OJB? Assuming the answer is No, I suppose I'll have to try it myself... Does anyone know of a similar report-from-xml-definition that I might draw ideas from? Keith -- Robert r. Sanders Chief Technologist iPOV www.ipov.net - 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]
Re: Creating Reports
Keith, You are not limited to static pre-compiled XML based reports with Jasper. There is also an API to generate reports on the fly. Look at Jasper's NoXmlDesignApp sample. Phil Keith Rogers wrote: It did not look easy to produce the following report, The report details which units in a course a student has passed. The rows are students, the columns are units (and one for the student id). The problem here is that the unit columns are retreived from the course, so it will not be known at runtime how many there are or what their names are. I undestand that it is possible to programmatically adjust the report definition, but this would then require me to use two XML docs for each report - the JasperReport xml and another to define how this should be modified at runtime. My impression (which I hope is wrong) is still that JasperReports is mainly a report presentation tool, and that producing tabular reports like the one above that has variable fields produced by a query at filling time would be difficult to do using it. Keith [EMAIL PROTECTED] 28/04/2004 12:53:20 Keith, We ve been using JasperReports with OJB por a while now. Reading your requirements, it seems JasperReports deservs a deep look. Let me quote you I'd like to be able to write a definition of the report in XML Well, this is exactly what you do with JR. Jasper will parser the report definition for you, will compile the report and will it have it ready to be filled which means run in JR jargon on demand. From JasperReports tutorial a simple report definition (http://jasperreports.sourceforge.net/tutorial/): ?xml version=1.0? !DOCTYPE jasperReport PUBLIC -//JasperReports//DTD Report Design//EN http://jasperreports.sourceforge.net/dtds/jasperreport.dtd; jasperReport name=name_of_the_report ... ... /jasperReport If you like to try a visual designer for JR try ireports at http://ireport.sourceforge.net/ JasperReports will work with any jdbc datasource and with OJB you will be able to pass him a collection of objects. BTW, we are no related to JR in any form. Regards, Gustavo. Keith Rogers [EMAIL PROTECTED] wrote on 28/04/2004 08:18:08 a.m.: Thanks to all who replied to this! All of these seem to be report presentation libraries rather than report generators, so I think I might try to write something more specific to my needs. Keith [EMAIL PROTECTED] 26/04/2004 14:30:28 A quick search of sourceforge finds: OpenReports : http://sourceforge.net/projects/oreports/ JasperReports : http://sourceforge.net/projects/jasperreports/ JFreeReport : http://sourceforge.net/projects/jfreereport/ I think all 3 of these tools use an xml based syntax. I have played around w/ then a little, but not enough to offer any advice. I don't think any integrate directly w/ OJB, but you could probably write a wrapper for the OJB Report Query class for use with the tools. Good luck. Keith Rogers wrote: I've gotten around to the part of my application that needs to produce reports on various things. Rather than hard-code reports, which would, admittedly make my job more secure :-) , I'd like to be able to write a definition of the report in XML, and have some parser take this and produce the report automatically on demand. I realise that this is not going to be a trivial task, so my first question is - Has anyone done anything similar for OJB? Assuming the answer is No, I suppose I'll have to try it myself... Does anyone know of a similar report-from-xml-definition that I might draw ideas from? Keith -- Robert r. Sanders Chief Technologist iPOV www.ipov.net - 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:
Re: How-to model a composite design pattern of java in the database (and repository)!
Georg, We went through these type of problems several times now. And I would say that using some tools we´ve resolved them trusting the tools proposed solutions (we believed those tools bring us others collegues knowledge and experience to our IDEs). This approach let us focus on the business side of building an app. We use Poseidon 2.x CE (www.gentleware.com) to model this type of problems and then we let AXgen from Peter Wieland (http://axgen.sourceforge.net/ Thanks Peter!) to generate repository user file, sql ddl and java code. This approach is very usefull when we do not need to reuse legacy RDMBS models. I´ve just did a sketch of your problem and have everythin ready to be implemented in 3 mins. Following AXgen Velocity based code generation patterns, an InventoryClass can be an Item or a Catalog, and depending future uses, you can define ItemCatalog and Item to be Abstract or Concrete classes (Axgen is expecting you to declare them as steretype Interfaces when you are not going to instantiate them). Then, a Item can be whatever you need to extends from it (Book, CompactDisc etc.). The key here is even with Catalog extending InventoryItem it HAS a collection of InventoryItems. Axgen patterns are based in a heavy use of interface programming. You can modify the code generator to your preferred patterns (Axgen uses Velocity templates). I´m mailing you the Poseidon based file with the model. Regards, Gustavo. Georg Klima [EMAIL PROTECTED] wrote on 28/04/2004 05:55:38 a.m.: Hello! I'm quiet new to ojb and maybe haven't read all possible materials about it. Excuse me if this is real newbie!! Problem: I have a library (university project) which has a COMPOSITE PATTERN (the one from gamma et'al) for implementing the storing of different types of objects (cds, books / catalogs and subcatalogs) generic. - 0..* has-a | InventoryEntry|-- |---| | | Operation() | | - | ? | | | | i-as| | || | || | --- | | Item | | Catalog |--- --- |Operation() | | Operation() | ---| Add(InentoryEntry) | |Remove(InentoryEntry)| |-| |Collection i_entries | --- Item and Catalog have a is-a relationship with Inventory Entry! Catalog has a has-a relationship with Inventory Entry. Later in the implementation the Books and CDs should be derived from Item (for now it's sufficient to say a book or what ever is an instance of Item). So how to model this in the database and the repository with storing instances of item and Catalog to the same Collection (i_entries) in java. (I do this by now having a Items Collection and a Catalog Collection in the Catalog Class. but these two different Collections should be merged to one in java). Besides this: A Catalog can have null or many (sub)catalogs and a Catalog can have null or many Items. A Item can be in one or many (sub)Catalogs. -- so I'm not only building a simple tree structure with this pattern, rather a more complex structure with everything allowed than circular graphs (because of then occurring endless loops traversing the structure). Excuse my bad English, but I haven't sleeped that much last night! Thanks Georg - 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: Creating Reports
I looked at jasper reports, but it seemed difficult to do what i needed (normal structured reports, and some very unstructured stuff) Firstly i went down the iText route (java pdf library). Wouldnt do the same again with hindsight - not enough control over positioning/margins especially in tables (and with large fonts), so pretty painful experience. After that i moved onto fop (apache) which is much nicer. Put your data into an xml document (at run time). Write an xsl file to add formating info (normally hard coded xsl file). Then at run time you simply apply the xsl file, and use fop to turn it into html/pdf. Daniel. -Original Message- From: Phil Warrick [mailto:[EMAIL PROTECTED] Sent: 28 April 2004 14:47 To: OJB Users List Subject: Re: Creating Reports Keith, You are not limited to static pre-compiled XML based reports with Jasper. There is also an API to generate reports on the fly. Look at Jasper's NoXmlDesignApp sample. Phil Keith Rogers wrote: It did not look easy to produce the following report, The report details which units in a course a student has passed. The rows are students, the columns are units (and one for the student id). The problem here is that the unit columns are retreived from the course, so it will not be known at runtime how many there are or what their names are. I undestand that it is possible to programmatically adjust the report definition, but this would then require me to use two XML docs for each report - the JasperReport xml and another to define how this should be modified at runtime. My impression (which I hope is wrong) is still that JasperReports is mainly a report presentation tool, and that producing tabular reports like the one above that has variable fields produced by a query at filling time would be difficult to do using it. Keith [EMAIL PROTECTED] 28/04/2004 12:53:20 Keith, We ve been using JasperReports with OJB por a while now. Reading your requirements, it seems JasperReports deservs a deep look. Let me quote you I'd like to be able to write a definition of the report in XML Well, this is exactly what you do with JR. Jasper will parser the report definition for you, will compile the report and will it have it ready to be filled which means run in JR jargon on demand. From JasperReports tutorial a simple report definition (http://jasperreports.sourceforge.net/tutorial/): ?xml version=1.0? !DOCTYPE jasperReport PUBLIC -//JasperReports//DTD Report Design//EN http://jasperreports.sourceforge.net/dtds/jasperreport.dtd; jasperReport name=name_of_the_report ... ... /jasperReport If you like to try a visual designer for JR try ireports at http://ireport.sourceforge.net/ JasperReports will work with any jdbc datasource and with OJB you will be able to pass him a collection of objects. BTW, we are no related to JR in any form. Regards, Gustavo. Keith Rogers [EMAIL PROTECTED] wrote on 28/04/2004 08:18:08 a.m.: Thanks to all who replied to this! All of these seem to be report presentation libraries rather than report generators, so I think I might try to write something more specific to my needs. Keith [EMAIL PROTECTED] 26/04/2004 14:30:28 A quick search of sourceforge finds: OpenReports : http://sourceforge.net/projects/oreports/ JasperReports : http://sourceforge.net/projects/jasperreports/ JFreeReport : http://sourceforge.net/projects/jfreereport/ I think all 3 of these tools use an xml based syntax. I have played around w/ then a little, but not enough to offer any advice. I don't think any integrate directly w/ OJB, but you could probably write a wrapper for the OJB Report Query class for use with the tools. Good luck. Keith Rogers wrote: I've gotten around to the part of my application that needs to produce reports on various things. Rather than hard-code reports, which would, admittedly make my job more secure :-) , I'd like to be able to write a definition of the report in XML, and have some parser take this and produce the report automatically on demand. I realise that this is not going to be a trivial task, so my first question is - Has anyone done anything similar for OJB? Assuming the answer is No, I suppose I'll have to try it myself... Does anyone know of a similar report-from-xml-definition that I might draw ideas from? Keith -- Robert r. Sanders Chief Technologist iPOV www.ipov.net - 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,
RE: Poor man trying to log....
Your configuration file references log4j. You must create a log4j.properties file with the following content log4j.rootLogger=DEBUG,console log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.ImmediateFlush=true log4j.appender.console.Target=System.out log4j.appender.console.layout.ConversionPattern=[%d{HH:mm:ss,SSS}] %m%n Guillaume -Message d'origine- De : Martin I. Levi [mailto:[EMAIL PROTECTED] Envoyé : mercredi 28 avril 2004 13:36 À : OJB Users List Objet : Poor man trying to log Hi, I would like to check OJBs logs but I really dont know how to configure them. I found that in OJB.properties there is a definition which reads: LoggerConfigFile=log4j.properties Can any one tell me which is this files format? The only thing Im sure is that I use PoorMansLoggerImpl and that this class logs using a simple System.out.println(), i wonder which out is this really because I dont see anything on my screen. :-) Is there any documentation about OJBs logging I can read? Help please! :-) 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]
Re: Creating Reports
It looks like you are facing a sort of pivot table challenge. Even when you expect just one single value for a known row, unknown column cell. In this case, you are in the right track. I I see no other way to pre-prepare the collection programmatically, and once known the number and name of the columns (your units), you can in two steps have the report done: step 1, based on some attributes of the resulting collection, write the XML report design. Then compile and fill the report. Just my 2 cents.. Regards, Gustavo. Keith Rogers [EMAIL PROTECTED] wrote on 28/04/2004 10:29:10 a.m.: It did not look easy to produce the following report, The report details which units in a course a student has passed. The rows are students, the columns are units (and one for the student id). The problem here is that the unit columns are retreived from the course, so it will not be known at runtime how many there are or what their names are. I undestand that it is possible to programmatically adjust the report definition, but this would then require me to use two XML docs for each report - the JasperReport xml and another to define how this should be modified at runtime. My impression (which I hope is wrong) is still that JasperReports is mainly a report presentation tool, and that producing tabular reports like the one above that has variable fields produced by a query at filling time would be difficult to do using it. Keith [EMAIL PROTECTED] 28/04/2004 12:53:20 Keith, We ve been using JasperReports with OJB por a while now. Reading your requirements, it seems JasperReports deservs a deep look. Let me quote you I'd like to be able to write a definition of the report in XML Well, this is exactly what you do with JR. Jasper will parser the report definition for you, will compile the report and will it have it ready to be filled which means run in JR jargon on demand. From JasperReports tutorial a simple report definition (http://jasperreports.sourceforge.net/tutorial/): ?xml version=1.0? !DOCTYPE jasperReport PUBLIC -//JasperReports//DTD Report Design//EN http://jasperreports.sourceforge.net/dtds/jasperreport.dtd; jasperReport name=name_of_the_report ... ... /jasperReport If you like to try a visual designer for JR try ireports at http://ireport.sourceforge.net/ JasperReports will work with any jdbc datasource and with OJB you will be able to pass him a collection of objects. BTW, we are no related to JR in any form. Regards, Gustavo. Keith Rogers [EMAIL PROTECTED] wrote on 28/04/2004 08:18:08 a.m.: Thanks to all who replied to this! All of these seem to be report presentation libraries rather than report generators, so I think I might try to write something more specific to my needs. Keith [EMAIL PROTECTED] 26/04/2004 14:30:28 A quick search of sourceforge finds: OpenReports : http://sourceforge.net/projects/oreports/ JasperReports : http://sourceforge.net/projects/jasperreports/ JFreeReport : http://sourceforge.net/projects/jfreereport/ I think all 3 of these tools use an xml based syntax. I have played around w/ then a little, but not enough to offer any advice. I don't think any integrate directly w/ OJB, but you could probably write a wrapper for the OJB Report Query class for use with the tools. Good luck. Keith Rogers wrote: I've gotten around to the part of my application that needs to produce reports on various things. Rather than hard-code reports, which would, admittedly make my job more secure :-) , I'd like to be able to write a definition of the report in XML, and have some parser take this and produce the report automatically on demand. I realise that this is not going to be a trivial task, so my first question is - Has anyone done anything similar for OJB? Assuming the answer is No, I suppose I'll have to try it myself... Does anyone know of a similar report-from-xml-definition that I might draw ideas from? Keith -- Robert r. Sanders Chief Technologist iPOV www.ipov.net - 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
RE: reverse-Tool with Oracle 8.1.7
Hi I found the specific class and added the follwing code to the class org.apache.ojb.tools.mapping.reversedb.DBSchema in the read-method before the call of this.addColumn(...): if(iDataType == java.sql.Types.DECIMAL){ if(iDecimalDigits0) { iDataType = java.sql.Types.DOUBLE; } else { iDataType = java.sql.Types.BIGINT; } } It's a simple workaround, perhaps it helps to develope a better revers-db-Tool in future... Roland Ribi -Original Message- From: Ribi Roland [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 28, 2004 2:19 PM To: '[EMAIL PROTECTED]' Subject: reverse-Tool with Oracle 8.1.7 Hi I would like to use the reverse-tool to genereate the repository.xml and the java code. But the reverse-tool takes always DECIMAL (JDBC-Type) and Long (Java-Type) for any Number column in Oracle. How can I override this so that a NUMBER(4) Column is mapped from BIGINT (JDBC-Type) to Long (Java) and a Column with NUMBER(6,2) is mapped from DOUBLE (JDBC-Type) to Double (Java)? Does I need to do this manually or can I declare the mapping in the OJB.properties or does I need to customize a class of OJB and if yes which one or how? With the default behavior I get ClasCastExceptions when I try to get any row from the database. Roland Ribi - 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: reverse-Tool with Oracle 8.1.7
I fogot one line: int iDecimalDigits = rs.getInt(DECIMAL_DIGITS); this comes before my other code: if(iDataType == java.sql.Types.DECIMAL){ if(iDecimalDigits0) { iDataType = java.sql.Types.DOUBLE; } else { iDataType = java.sql.Types.BIGINT; } } Roland Ribi -Original Message- From: Ribi Roland [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 28, 2004 4:57 PM To: 'OJB Users List' Subject: RE: reverse-Tool with Oracle 8.1.7 Hi I found the specific class and added the follwing code to the class org.apache.ojb.tools.mapping.reversedb.DBSchema in the read-method before the call of this.addColumn(...): if(iDataType == java.sql.Types.DECIMAL){ if(iDecimalDigits0) { iDataType = java.sql.Types.DOUBLE; } else { iDataType = java.sql.Types.BIGINT; } } It's a simple workaround, perhaps it helps to develope a better revers-db-Tool in future... Roland Ribi -Original Message- From: Ribi Roland [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 28, 2004 2:19 PM To: '[EMAIL PROTECTED]' Subject: reverse-Tool with Oracle 8.1.7 Hi I would like to use the reverse-tool to genereate the repository.xml and the java code. But the reverse-tool takes always DECIMAL (JDBC-Type) and Long (Java-Type) for any Number column in Oracle. How can I override this so that a NUMBER(4) Column is mapped from BIGINT (JDBC-Type) to Long (Java) and a Column with NUMBER(6,2) is mapped from DOUBLE (JDBC-Type) to Double (Java)? Does I need to do this manually or can I declare the mapping in the OJB.properties or does I need to customize a class of OJB and if yes which one or how? With the default behavior I get ClasCastExceptions when I try to get any row from the database. Roland Ribi - 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]
Multiple Joins problem.
Hi, I have an issue with making multiple joins between two tables. I have a basic contact table with a 1-many relationship to a simpleProperty table - which consists of name-value pair records to dynamically extend my data set. If I query with just one simple property it works just fine: PB code (select all contacts with a simpleproperty subscribed=true): Criteria criteria = new Criteria(); criteria.addEqualTo(simplePropertys.name, subscribed); criteria.addEqualTo(simplePropertys.booleanValue, new Boolean(true)); int count = broker.getCount(new QueryByCriteria(ContactImpl.class, criteria)); This causes the following SQL to run against the DB server: SELECT count(*) FROM Contact A0 INNER JOIN SimpleProperty A1 ON A0.conOID=A1.simContactOID WHERE (A1.simName = @P1 ) AND A1.simBooleanValue = @P2 Which is exactly what I want! My problem starts if I want to query with two simplePropertys for example, where subscribed=true AND region=Asia Criteria criteria = new Criteria(); criteria.addEqualTo(simplePropertys.name, subscribed); criteria.addEqualTo(simplePropertys.booleanValue, new Boolean(true)); Criteria criteria2 = new Criteria(); criteria2.addEqualTo(simplePropertys.name, region); criteria2.addEqualTo(simplePropertys.stringValue, Asia); Criteria criteria3 = new Criteria(); criteria3.addAndCriteria(criteria); criteria3.addAndCriteria(criteria2); int count3 = broker.getCount(new QueryByCriteria(ContactImpl.class, criteria3)); This causes the following SQL to run: SELECT count(*) FROM Contact A0 INNER JOIN SimpleProperty A1 ON A0.conOID=A1.simContactOID WHERE ( (A1.simName = @P1 ) AND A1.simBooleanValue = @P2 ) AND ((A1.simName = @P3 ) AND A1.simStringValue = @P4 ) This returns 0 results as it's only using one join for both properties. The SQL I need uses two joins like this: SELECT * FROM Contact INNER JOIN SimpleProperty s1 ON Contact.conOID = s1.simContactOID INNER JOIN SimpleProperty s2 ON Contact.conOID = s2.simContactOID WHERE (s1.simName = 'subscribed') AND (s1.simBooleanValue = 1) AND (s2.simStringValue = 'Asia') AND (s2.simName = 'region') In my application, criteria assembly is happening on-the-fly so I would rather not use QueryBySQL if I can avoid it. Does anyone have any Ideas on how to use the PersistenceBroker / Criteria API to build multiple joins between the same tables as per the SQL example above? Many thanks for your help, Brendan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Update problem using PersistenceBroker api
Hi Stijn, do you use OJB default settings (OJB.properties)? Your test seems ok. regards, Armin Stijn de Witt wrote: I have created a test program that attempts to load a Candidate from the database with lastName=Tester. If none is found it creates a new one. It then sets the title field to a random string and stores the object. On the first run, no candidate is found (as expected) and a new one is created and stored correctly. On the second run, the candidate stored before is found correctly, and the title is set to a new random string. broker.store() is called and finishes with no errors. When I look in the database however, the title field is not changed... What am I doing wrong? -Stijn package nl.bergland.codamo; import java.util.*; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; import org.apache.ojb.broker.PersistenceBrokerFactory; import org.apache.ojb.broker.PersistenceBroker; import org.apache.ojb.broker.query.*; public class OjbTester { private static final Logger logger = LogManager.getLogger(OjbTester.class.getName()); /** Creates a new instance of Test */ public OjbTester() { } public static void main(String[] args) { PropertyConfigurator.configure(log4j.properties); logger.info(main: Starting...); logger.info(main: Getting persistence broker...); PersistenceBroker broker = null; try { broker = PersistenceBrokerFactory.defaultPersistenceBroker(); logger.info(main: Creating query criteria...); Criteria crit = new Criteria(); logger.info(main: Set criteria lastName==\Tester\...); crit.addEqualTo(lastName, Tester); logger.info(main: Create query...); Query q = QueryFactory.newQuery(Candidate.class, crit); logger.info(main: Fire query for a Candidate with lastName == \Tester\...); Collection results = broker.getCollectionByQuery(q); logger.info(main: Get result (if any)...); broker.close(); broker = PersistenceBrokerFactory.defaultPersistenceBroker(); logger.info(main: Starting transaction...); broker.beginTransaction(); Iterator it = results.iterator(); Candidate candidate; if (it.hasNext()) { logger.info(main: Found a candidate...); candidate = (Candidate) it.next(); } else { logger.info(main: No candidate found, create new...); candidate = new Candidate(); candidate.setFirstName(Tommy); candidate.setLastName(Tester); } logger.info(main: Assign availableFrom as current Date...); candidate.setAvailableFrom(new java.sql.Date(new java.util.Date().getTime())); logger.info(main: Set random title...); Random rand = new Random(); byte[] bytes = new byte[4]; rand.nextBytes(bytes); String title = new String(); for (int i=0; ibytes.length; i++) { Byte bt = new Byte(bytes[i]); title += bt.toString(); } logger.info(main: Set candidate.title == + title + ...); candidate.setTitle(title); logger.info(main: Trying to store candidate...); broker.store(candidate); logger.info(main: Stored candidate + candidate.getId()); logger.info(main: Commit transaction...); broker.commitTransaction(); } catch(Exception e) { if (broker == null) logger.error(main: ERROR getting persistence broker: + e.getMessage()); else { logger.error(main: ERROR: + e.getMessage()); if (broker.isInTransaction()) { logger.error(main: Rollback Transaction...); broker.abortTransaction(); } } } finally { if (broker != null) broker.close(); } logger.info(main: Done.); } } - 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: Clustered cache with OSCache JavaGroups
That's correct. But it apparently isn't clear enough. I will add a short note to the documentation about that. Jason On Wed, 2004-04-28 at 01:42, Enrique Medina wrote: Solved! The problem was, as I commented in my post, a misconception about what a distributed cache really has to do. I thought even read changes had to be notified to the rest of the cluster, but after a deep reading and investigation of other managers of distributed cache, I realized that only updating changes are communicated through JGroups by OSCache. Thanks anyway for the support, Enrique Medina. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Thu, 22 Apr 2004 08:05:26 -0700 OK, I won't be able to exactly duplicate your environment since we don't have any windows computers here at the Open Source Lab, but I'll see what I can get. Shouldn't matter anyway, but it always seems too... Jason On Thu, 2004-04-22 at 00:10, Enrique Medina wrote: Websphere Server within WSAD 5.1 Windows 2000 Professional From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 12:45:45 -0700 Not really sure what the problem is here. I will attempt to set up some nodes here at the OSL over the next day or two and debug. What Web container/OS are you using? Jason On Wed, 2004-04-21 at 11:14, Enrique Medina wrote: Cache events are correct, but they are local. I mean, when the first instance caches an object, it is supposed to inform the other instance, through JavaGroups, but this communication doesn't happen. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 10:24:41 -0700 The debug output will show the cache events being handled such as read and gets from the cache. Jason On Wed, 2004-04-21 at 09:53, Enrique Medina wrote: What do you exactly want to log? What do you want me to show about the logging messages? From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 08:20:56 -0700 Can you add the a line to your/a log4j properties files that lowers the debug level? It would look like: log4j.category.com.opensymphony.oscache=DEBUG On Wed, 2004-04-21 at 07:58, Enrique Medina wrote: Hi, I have developed a web application with OJB, as the ORM for data access. But now, I want to use OJB in a clustered environment. I have read with attention the information provided at the web: http://db.apache.org/ojb/howto-work-with-clustering.html with respect to setting up OSCache to work with OJB in a cluster. I have strictly followed all the steps commented in this tutorial, and have made a little client test application to see the results. Everything seems to start perfectly, but no cache communication exists between two instances of this client test application at all! I am using OJB RC6 with latest version of OSCache JavaGroups deployed within OSCache distribution. I have a simple test application consisting of: 1 public static void main(String[] args) 2 { 3 // Obtain a connection through OJB broker. 4 PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); 5 6 // Create a new query by example that should return all clients. 7 Query query = QueryFactory.newQueryByExample(new ClientVO()); 8 Collection clients = broker.getCollectionByQuery(query); 9 10// Ask again for the collection of clients. 11Collection againClients = broker.getCollectionByQuery(query); 12 } I set a breakpoint on lines 8 and 11, just before obtaining the clients for the first time and for the second time. The sequence of steps I follow to see if two instances of the program communicate at cache level through JavaGroups are: 1) I run a first instance of this test application 1.1) The thread of execution gets stopped on line 4 (first
Re: Clustered cache with OSCache JavaGroups
Is that in CVS or in the latest release? JAson On Wed, 2004-04-28 at 09:20, Armin Waibel wrote: Jason McKerr wrote: That's correct. But it apparently isn't clear enough. I will add a short note to the documentation about that. Jason, please check out the new howto-work-with-clustering.xml under [db-ojb]/forrest/src/documentation/content/xdocs/docu Thanks! regards, Armin Jason On Wed, 2004-04-28 at 01:42, Enrique Medina wrote: Solved! The problem was, as I commented in my post, a misconception about what a distributed cache really has to do. I thought even read changes had to be notified to the rest of the cluster, but after a deep reading and investigation of other managers of distributed cache, I realized that only updating changes are communicated through JGroups by OSCache. Thanks anyway for the support, Enrique Medina. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Thu, 22 Apr 2004 08:05:26 -0700 OK, I won't be able to exactly duplicate your environment since we don't have any windows computers here at the Open Source Lab, but I'll see what I can get. Shouldn't matter anyway, but it always seems too... Jason On Thu, 2004-04-22 at 00:10, Enrique Medina wrote: Websphere Server within WSAD 5.1 Windows 2000 Professional From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 12:45:45 -0700 Not really sure what the problem is here. I will attempt to set up some nodes here at the OSL over the next day or two and debug. What Web container/OS are you using? Jason On Wed, 2004-04-21 at 11:14, Enrique Medina wrote: Cache events are correct, but they are local. I mean, when the first instance caches an object, it is supposed to inform the other instance, through JavaGroups, but this communication doesn't happen. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 10:24:41 -0700 The debug output will show the cache events being handled such as read and gets from the cache. Jason On Wed, 2004-04-21 at 09:53, Enrique Medina wrote: What do you exactly want to log? What do you want me to show about the logging messages? From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 08:20:56 -0700 Can you add the a line to your/a log4j properties files that lowers the debug level? It would look like: log4j.category.com.opensymphony.oscache=DEBUG On Wed, 2004-04-21 at 07:58, Enrique Medina wrote: Hi, I have developed a web application with OJB, as the ORM for data access. But now, I want to use OJB in a clustered environment. I have read with attention the information provided at the web: http://db.apache.org/ojb/howto-work-with-clustering.html with respect to setting up OSCache to work with OJB in a cluster. I have strictly followed all the steps commented in this tutorial, and have made a little client test application to see the results. Everything seems to start perfectly, but no cache communication exists between two instances of this client test application at all! I am using OJB RC6 with latest version of OSCache JavaGroups deployed within OSCache distribution. I have a simple test application consisting of: 1 public static void main(String[] args) 2 { 3 // Obtain a connection through OJB broker. 4 PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); 5 6 // Create a new query by example that should return all clients. 7 Query query = QueryFactory.newQueryByExample(new ClientVO()); 8 Collection clients = broker.getCollectionByQuery(query); 9 10 // Ask again for the collection of clients. 11 Collection againClients = broker.getCollectionByQuery(query); 12 } I set a breakpoint on lines 8 and 11, just before obtaining the clients for the first time and for the second time. The sequence of steps I follow to see if two instances of the program communicate at cache level through JavaGroups are: 1) I run a first instance of this test application 1.1) The thread of execution gets stopped on line 4 (first instance). The JavaGroups logging says -- A new member at address '192.168.0.1:1590' has joined the cluster 2) Then I run a second instance of the application
Re: Clustered cache with OSCache JavaGroups
it's in CVS, we do a migration to Forrest for document generation Armin Jason McKerr wrote: Is that in CVS or in the latest release? JAson On Wed, 2004-04-28 at 09:20, Armin Waibel wrote: Jason McKerr wrote: That's correct. But it apparently isn't clear enough. I will add a short note to the documentation about that. Jason, please check out the new howto-work-with-clustering.xml under [db-ojb]/forrest/src/documentation/content/xdocs/docu Thanks! regards, Armin Jason On Wed, 2004-04-28 at 01:42, Enrique Medina wrote: Solved! The problem was, as I commented in my post, a misconception about what a distributed cache really has to do. I thought even read changes had to be notified to the rest of the cluster, but after a deep reading and investigation of other managers of distributed cache, I realized that only updating changes are communicated through JGroups by OSCache. Thanks anyway for the support, Enrique Medina. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Thu, 22 Apr 2004 08:05:26 -0700 OK, I won't be able to exactly duplicate your environment since we don't have any windows computers here at the Open Source Lab, but I'll see what I can get. Shouldn't matter anyway, but it always seems too... Jason On Thu, 2004-04-22 at 00:10, Enrique Medina wrote: Websphere Server within WSAD 5.1 Windows 2000 Professional From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 12:45:45 -0700 Not really sure what the problem is here. I will attempt to set up some nodes here at the OSL over the next day or two and debug. What Web container/OS are you using? Jason On Wed, 2004-04-21 at 11:14, Enrique Medina wrote: Cache events are correct, but they are local. I mean, when the first instance caches an object, it is supposed to inform the other instance, through JavaGroups, but this communication doesn't happen. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 10:24:41 -0700 The debug output will show the cache events being handled such as read and gets from the cache. Jason On Wed, 2004-04-21 at 09:53, Enrique Medina wrote: What do you exactly want to log? What do you want me to show about the logging messages? From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 08:20:56 -0700 Can you add the a line to your/a log4j properties files that lowers the debug level? It would look like: log4j.category.com.opensymphony.oscache=DEBUG On Wed, 2004-04-21 at 07:58, Enrique Medina wrote: Hi, I have developed a web application with OJB, as the ORM for data access. But now, I want to use OJB in a clustered environment. I have read with attention the information provided at the web: http://db.apache.org/ojb/howto-work-with-clustering.html with respect to setting up OSCache to work with OJB in a cluster. I have strictly followed all the steps commented in this tutorial, and have made a little client test application to see the results. Everything seems to start perfectly, but no cache communication exists between two instances of this client test application at all! I am using OJB RC6 with latest version of OSCache JavaGroups deployed within OSCache distribution. I have a simple test application consisting of: 1 public static void main(String[] args) 2 { 3 // Obtain a connection through OJB broker. 4 PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); 5 6 // Create a new query by example that should return all clients. 7 Query query = QueryFactory.newQueryByExample(new ClientVO()); 8 Collection clients = broker.getCollectionByQuery(query); 9 10 // Ask again for the collection of clients. 11 Collection againClients = broker.getCollectionByQuery(query); 12 } I set a breakpoint on lines 8 and 11, just before obtaining the clients for the first time and for the second time. The sequence of steps I follow to see if two instances of the program communicate at cache level through JavaGroups are: 1) I run a first instance of this test application 1.1) The thread of execution gets stopped on line 4 (first instance). The JavaGroups logging says -- A new member at address '192.168.0.1:1590' has joined the cluster 2) Then I run a second instance of the application 2.1) The thread of execution gets stopped on line 4 (second instance). I see on the console how the first instance is notified
Re: Multiple Joins problem.
hi brendan, when ojb builds the joins it checks if there's is already a join for a given path. that's why it produces only one join for multiple criteria. if you want to force it to use multiple joins you'll have to define an alias on each criteria: crit1.setAlias('subscribed'); crit2.setAlias('region'); afaik this feature is in the documentation. hth jakob Brendan Richards wrote: Hi, I have an issue with making multiple joins between two tables. I have a basic contact table with a 1-many relationship to a simpleProperty table - which consists of name-value pair records to dynamically extend my data set. If I query with just one simple property it works just fine: PB code (select all contacts with a simpleproperty subscribed=true): Criteria criteria = new Criteria(); criteria.addEqualTo(simplePropertys.name, subscribed); criteria.addEqualTo(simplePropertys.booleanValue, new Boolean(true)); int count = broker.getCount(new QueryByCriteria(ContactImpl.class, criteria)); This causes the following SQL to run against the DB server: SELECT count(*) FROM Contact A0 INNER JOIN SimpleProperty A1 ON A0.conOID=A1.simContactOID WHERE (A1.simName = @P1 ) AND A1.simBooleanValue = @P2 Which is exactly what I want! My problem starts if I want to query with two simplePropertys for example, where subscribed=true AND region=Asia Criteria criteria = new Criteria(); criteria.addEqualTo(simplePropertys.name, subscribed); criteria.addEqualTo(simplePropertys.booleanValue, new Boolean(true)); Criteria criteria2 = new Criteria(); criteria2.addEqualTo(simplePropertys.name, region); criteria2.addEqualTo(simplePropertys.stringValue, Asia); Criteria criteria3 = new Criteria(); criteria3.addAndCriteria(criteria); criteria3.addAndCriteria(criteria2); int count3 = broker.getCount(new QueryByCriteria(ContactImpl.class, criteria3)); This causes the following SQL to run: SELECT count(*) FROM Contact A0 INNER JOIN SimpleProperty A1 ON A0.conOID=A1.simContactOID WHERE ( (A1.simName = @P1 ) AND A1.simBooleanValue = @P2 ) AND ((A1.simName = @P3 ) AND A1.simStringValue = @P4 ) This returns 0 results as it's only using one join for both properties. The SQL I need uses two joins like this: SELECT * FROM Contact INNER JOIN SimpleProperty s1 ON Contact.conOID = s1.simContactOID INNER JOIN SimpleProperty s2 ON Contact.conOID = s2.simContactOID WHERE (s1.simName = 'subscribed') AND (s1.simBooleanValue = 1) AND (s2.simStringValue = 'Asia') AND (s2.simName = 'region') In my application, criteria assembly is happening on-the-fly so I would rather not use QueryBySQL if I can avoid it. Does anyone have any Ideas on how to use the PersistenceBroker / Criteria API to build multiple joins between the same tables as per the SQL example above? Many thanks for your help, Brendan. - 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]
Help to locate and update a collection member (big collection)
Dumb problem, but weve get some confusion here. Lets say we have a Master object that has a Details object collection. Details collection is a 10ths thousand objects set. Repository settings for Master object are autoupdate true, autoretrieve true,autodelete true. API is PB. Our user need to query for one specific Master object (no problem with this using Query object), change some attributes, then browse (paging) through the thousand Detail objects, until he founds the one he is looking for, to update some attributes in it - remember the Detail object- (lets say an iterator will do this fine) . We do not have any problems on the UI side. The client app returns the data modified by the user (the Master object data and the Detail object data). Back in the server, doubts start again. Question here is, which is the right way to persist the changes to the DB? Pseudo code seems to be: 1. Retrieve Master Object. 2. Update some attributes 3. Retrieve Detail object from the Master Object collection * 4. Update some Detail attributes 5. store de Master Object. We find easy to retrieve the Master Object, but we do not see the proper way to retrieve and update the Detail object in the collection autoretrieved by the Master object. * How should we look for the Detail object? And then, how should we update an individual in a big autoretrieved collection? The mechanism available to retrieve certain object within PBAPI is the Query Object, but we do no see any OJB based methods to find an object in a autoretrieved collection. This means we should query the Detail object outside the collection (I mean find the single Detail object in the DB using a Query object ) In this case, once we get the reference to this object and we persist it back (the Detail object), the in-memory collection retrieved by the Master object will be updated? What if the association between Master an Detail, from a business perspective is a compound association? The Detail may exist or not, but when yes, it does so allways compunding a Master object, which means we should add him to the collection letting OJB handle the persistence directly? Some code snippet might enlighten us Thanks in advance, Gustavo.
Re: Clustered cache with OSCache JavaGroups
Hey Armin, Sorry it took me so long. I've finally got some nodes up and running and will begin testing the cluster. I'm still a bit confused as to how to integrate Thomas's lock servlet with an existing servlet infrastructure in a simple way, but I'll get there. J On Wed, 2004-04-28 at 09:25, Armin Waibel wrote: it's in CVS, we do a migration to Forrest for document generation Armin Jason McKerr wrote: Is that in CVS or in the latest release? JAson On Wed, 2004-04-28 at 09:20, Armin Waibel wrote: Jason McKerr wrote: That's correct. But it apparently isn't clear enough. I will add a short note to the documentation about that. Jason, please check out the new howto-work-with-clustering.xml under [db-ojb]/forrest/src/documentation/content/xdocs/docu Thanks! regards, Armin Jason On Wed, 2004-04-28 at 01:42, Enrique Medina wrote: Solved! The problem was, as I commented in my post, a misconception about what a distributed cache really has to do. I thought even read changes had to be notified to the rest of the cluster, but after a deep reading and investigation of other managers of distributed cache, I realized that only updating changes are communicated through JGroups by OSCache. Thanks anyway for the support, Enrique Medina. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Thu, 22 Apr 2004 08:05:26 -0700 OK, I won't be able to exactly duplicate your environment since we don't have any windows computers here at the Open Source Lab, but I'll see what I can get. Shouldn't matter anyway, but it always seems too... Jason On Thu, 2004-04-22 at 00:10, Enrique Medina wrote: Websphere Server within WSAD 5.1 Windows 2000 Professional From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 12:45:45 -0700 Not really sure what the problem is here. I will attempt to set up some nodes here at the OSL over the next day or two and debug. What Web container/OS are you using? Jason On Wed, 2004-04-21 at 11:14, Enrique Medina wrote: Cache events are correct, but they are local. I mean, when the first instance caches an object, it is supposed to inform the other instance, through JavaGroups, but this communication doesn't happen. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 10:24:41 -0700 The debug output will show the cache events being handled such as read and gets from the cache. Jason On Wed, 2004-04-21 at 09:53, Enrique Medina wrote: What do you exactly want to log? What do you want me to show about the logging messages? From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 08:20:56 -0700 Can you add the a line to your/a log4j properties files that lowers the debug level? It would look like: log4j.category.com.opensymphony.oscache=DEBUG On Wed, 2004-04-21 at 07:58, Enrique Medina wrote: Hi, I have developed a web application with OJB, as the ORM for data access. But now, I want to use OJB in a clustered environment. I have read with attention the information provided at the web: http://db.apache.org/ojb/howto-work-with-clustering.html with respect to setting up OSCache to work with OJB in a cluster. I have strictly followed all the steps commented in this tutorial, and have made a little client test application to see the results. Everything seems to start perfectly, but no cache communication exists between two instances of this client test application at all! I am using OJB RC6 with latest version of OSCache JavaGroups deployed within OSCache distribution. I have a simple test application consisting of: 1 public static void main(String[] args) 2 { 3 // Obtain a connection through OJB broker. 4 PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); 5 6 // Create a new query by example that should return all clients. 7 Query query = QueryFactory.newQueryByExample(new ClientVO()); 8 Collection clients = broker.getCollectionByQuery(query); 9 10// Ask again for the collection of clients. 11Collection againClients = broker.getCollectionByQuery(query); 12 } I set a breakpoint on lines 8 and 11, just
Re: Clustered cache with OSCache JavaGroups
Jason McKerr wrote: Hey Armin, Sorry it took me so long. no problem, you don't get money for it ;-) I've finally got some nodes up and running and will begin testing the cluster. I'm still a bit confused as to how to integrate Thomas's lock servlet with an existing servlet infrastructure in a simple way, but I'll get there. This isn't trivial stuff, personally I never tried the distributed lock manager. Armin J On Wed, 2004-04-28 at 09:25, Armin Waibel wrote: it's in CVS, we do a migration to Forrest for document generation Armin Jason McKerr wrote: Is that in CVS or in the latest release? JAson On Wed, 2004-04-28 at 09:20, Armin Waibel wrote: Jason McKerr wrote: That's correct. But it apparently isn't clear enough. I will add a short note to the documentation about that. Jason, please check out the new howto-work-with-clustering.xml under [db-ojb]/forrest/src/documentation/content/xdocs/docu Thanks! regards, Armin Jason On Wed, 2004-04-28 at 01:42, Enrique Medina wrote: Solved! The problem was, as I commented in my post, a misconception about what a distributed cache really has to do. I thought even read changes had to be notified to the rest of the cluster, but after a deep reading and investigation of other managers of distributed cache, I realized that only updating changes are communicated through JGroups by OSCache. Thanks anyway for the support, Enrique Medina. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Thu, 22 Apr 2004 08:05:26 -0700 OK, I won't be able to exactly duplicate your environment since we don't have any windows computers here at the Open Source Lab, but I'll see what I can get. Shouldn't matter anyway, but it always seems too... Jason On Thu, 2004-04-22 at 00:10, Enrique Medina wrote: Websphere Server within WSAD 5.1 Windows 2000 Professional From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 12:45:45 -0700 Not really sure what the problem is here. I will attempt to set up some nodes here at the OSL over the next day or two and debug. What Web container/OS are you using? Jason On Wed, 2004-04-21 at 11:14, Enrique Medina wrote: Cache events are correct, but they are local. I mean, when the first instance caches an object, it is supposed to inform the other instance, through JavaGroups, but this communication doesn't happen. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 10:24:41 -0700 The debug output will show the cache events being handled such as read and gets from the cache. Jason On Wed, 2004-04-21 at 09:53, Enrique Medina wrote: What do you exactly want to log? What do you want me to show about the logging messages? From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 08:20:56 -0700 Can you add the a line to your/a log4j properties files that lowers the debug level? It would look like: log4j.category.com.opensymphony.oscache=DEBUG On Wed, 2004-04-21 at 07:58, Enrique Medina wrote: Hi, I have developed a web application with OJB, as the ORM for data access. But now, I want to use OJB in a clustered environment. I have read with attention the information provided at the web: http://db.apache.org/ojb/howto-work-with-clustering.html with respect to setting up OSCache to work with OJB in a cluster. I have strictly followed all the steps commented in this tutorial, and have made a little client test application to see the results. Everything seems to start perfectly, but no cache communication exists between two instances of this client test application at all! I am using OJB RC6 with latest version of OSCache JavaGroups deployed within OSCache distribution. I have a simple test application consisting of: 1 public static void main(String[] args) 2 { 3 // Obtain a connection through OJB broker. 4 PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker(); 5 6 // Create a new query by example that should return all clients. 7 Query query = QueryFactory.newQueryByExample(new ClientVO()); 8 Collection clients = broker.getCollectionByQuery(query); 9 10 // Ask again for the collection of clients. 11 Collection againClients = broker.getCollectionByQuery(query); 12 } I set a breakpoint on lines 8 and 11, just before obtaining the clients for the first time and for the second time. The sequence of
Re: Clustered cache with OSCache JavaGroups
Actually, since I work at the Open Source Lab, I am getting paid to do open source. Just not by you guys. :) Jason On Wed, 2004-04-28 at 11:01, Armin Waibel wrote: Jason McKerr wrote: Hey Armin, Sorry it took me so long. no problem, you don't get money for it ;-) I've finally got some nodes up and running and will begin testing the cluster. I'm still a bit confused as to how to integrate Thomas's lock servlet with an existing servlet infrastructure in a simple way, but I'll get there. This isn't trivial stuff, personally I never tried the distributed lock manager. Armin J On Wed, 2004-04-28 at 09:25, Armin Waibel wrote: it's in CVS, we do a migration to Forrest for document generation Armin Jason McKerr wrote: Is that in CVS or in the latest release? JAson On Wed, 2004-04-28 at 09:20, Armin Waibel wrote: Jason McKerr wrote: That's correct. But it apparently isn't clear enough. I will add a short note to the documentation about that. Jason, please check out the new howto-work-with-clustering.xml under [db-ojb]/forrest/src/documentation/content/xdocs/docu Thanks! regards, Armin Jason On Wed, 2004-04-28 at 01:42, Enrique Medina wrote: Solved! The problem was, as I commented in my post, a misconception about what a distributed cache really has to do. I thought even read changes had to be notified to the rest of the cluster, but after a deep reading and investigation of other managers of distributed cache, I realized that only updating changes are communicated through JGroups by OSCache. Thanks anyway for the support, Enrique Medina. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Thu, 22 Apr 2004 08:05:26 -0700 OK, I won't be able to exactly duplicate your environment since we don't have any windows computers here at the Open Source Lab, but I'll see what I can get. Shouldn't matter anyway, but it always seems too... Jason On Thu, 2004-04-22 at 00:10, Enrique Medina wrote: Websphere Server within WSAD 5.1 Windows 2000 Professional From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 12:45:45 -0700 Not really sure what the problem is here. I will attempt to set up some nodes here at the OSL over the next day or two and debug. What Web container/OS are you using? Jason On Wed, 2004-04-21 at 11:14, Enrique Medina wrote: Cache events are correct, but they are local. I mean, when the first instance caches an object, it is supposed to inform the other instance, through JavaGroups, but this communication doesn't happen. From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 10:24:41 -0700 The debug output will show the cache events being handled such as read and gets from the cache. Jason On Wed, 2004-04-21 at 09:53, Enrique Medina wrote: What do you exactly want to log? What do you want me to show about the logging messages? From: Jason McKerr [EMAIL PROTECTED] Reply-To: OJB Users List [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Subject: Re: Clustered cache with OSCache JavaGroups Date: Wed, 21 Apr 2004 08:20:56 -0700 Can you add the a line to your/a log4j properties files that lowers the debug level? It would look like: log4j.category.com.opensymphony.oscache=DEBUG On Wed, 2004-04-21 at 07:58, Enrique Medina wrote: Hi, I have developed a web application with OJB, as the ORM for data access. But now, I want to use OJB in a clustered environment. I have read with attention the information provided at the web: http://db.apache.org/ojb/howto-work-with-clustering.html with respect to setting up OSCache to work with OJB in a cluster. I have strictly followed all the steps commented in this tutorial, and have made a little client test application to see the results. Everything seems to start perfectly, but no cache communication exists between two instances of this client test application at all! I am using OJB RC6 with latest version of OSCache JavaGroups deployed within OSCache distribution. I have a simple test application consisting of: 1 public static void main(String[] args) 2 { 3 // Obtain a connection through OJB broker. 4 PersistenceBroker broker =
Second try: (ODMG) Transaction.abort() vs. object rollback
Does anybody have any insight on the post-abort state of persistent objects? I'm in a bit of a bind if my understanding of this is correct. thanks, -steve From: Steve Clark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: (ODMG) Transaction.abort() vs. object rollback Date: Tue, 27 Apr 2004 13:20:54 -0600 The way I read the Javadocs, if I make some changes to persistent objects which are locked to an ODMG Transaction, and then Transaction.commit() fails, e.g. due to a database constraint violation, then the objects in memory should be rolled back to their state prior to the Transaction. Is my understanding correct? I am seeing the following behavior: tx1.begin(); parent = fetchParent(); tx1.commit(); assert(parent.getChildren().size() == 1); tx2.begin(); child = new Child(); child.setSomeAttributeToInvalidValue(); tx.lock(parent, WRITE); parent.addChild(child); try { tx2.commit(); } catch TransactionAbortedException { assert(parent.getChildren().size() == 2); } My child object contains a value which violates a database constraint. On commit(), the Transaction, as expected, throws TransactionAbortedException. But the new Child object is still in the parent's collection of children, so future Transactions involving this parent will fail (including deletePersistent(), which attempts to insert the missing Child, not realizing that it will be immediately deleted). Is this the correct behavior? Should this be the expected behavior? If the answer to both questions is yes, then I think the Javadocs need some clarification. Finally, if this is the correct behavior, what are others doing to address this situation? I'm using CVS HEAD as of a week or so ago. thanks, -- Steve Clark Technology Applications Team Natural Resources Research Center/USGS [EMAIL PROTECTED] (970)226-9291 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Steve Clark Technology Applications Team Natural Resources Research Center/USGS [EMAIL PROTECTED] (970)226-9291 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: clear() collection proxy RemovalAware
Is this already in CVS? This fix is correct? Thanks, Edson Richter After some research, I've found an implementation that works: public void clear() { Collection coll; if(getData()instanceof ManageableCollection) { getData().clear(); // ECER: assure it will notify all being removed, necessary for RemovalAware classes... } else { // BRJ: use an empty collection so isLoaded will return true try { coll = (Collection) getCollectionClass().newInstance(); } catch (Exception e) { coll = new ArrayList(); } setData(coll); _size = 0; } } Could someone cofirm/fix this in CVS? Thanks, Edson Richter Edson Carlos Ericksson Richter wrote: I think I and a co-worker (Igor) found a little bug in collection proxy. When using RemovalAware... as class for a collection descriptor, calling clear() in the collection don't register the objects for deletion. The answer is the clear implementation in CollectionProxyDefaultImpl: public void clear() { Collection coll; // BRJ: use an empty collection so isLoaded will return true try { coll = (Collection) getCollectionClass().newInstance(); } catch (Exception e) { coll = new ArrayList(); } setData(coll); _size = 0; } I think the right method should be: public void clear() { Collection coll; getData().clear(); // ECER: assure it will notify all being removed, necessary for RemovalAware classes... // BRJ: use an empty collection so isLoaded will return true try { coll = (Collection) getCollectionClass().newInstance(); } catch (Exception e) { coll = new ArrayList(); } setData(coll); _size = 0; } Could you analize and report if this is right? Thanks, Edson Richter - 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]