Re: Flattened relationship and iterator oddness

2006-09-09 Thread Jean Pierre Malrieu

I stumbbled on this one too. Did someone file a bug report ?

JPM



Fabian,

I discovered this a month or two ago.  It appears as if iterator()
does not fire the fault on relationships.  That is why with your log
statement everything is ok: the accessing of the productionRuns()
field IS firing the fault.  The iterator then works.  This is a bug
in the iterator implementation.  The only thing you can do is either
manually fire each fault or use objectEnumerator().  I use
objectEnumerator().

John

On Sep 8, 2006, at 4:28 PM, Fabian Peters wrote:



Hi,

I've got the following entities:

Order <->> OrderItem <<->> ProductionRun <-> DeliveryDefect

In Order, I've defined a flattened relationship deliveryDefects. It
works fine for deliveryDefects that exist when the order is fetched
from the DB. However, it fails to include a deliveryDefect that is
created and then saved to the DB. Is this a known limitation of
flattened relationships?

Not all too important since I can of course get to it myself. Part
of my first implementation looked like this:

for (Iterator iter = orderItems().iterator(); iter.hasNext
();) {
OrderItem anOrderItem = (OrderItem) iter.next();
// log.debug("production run count: " +
anOrderItem.productionRuns().count());
for (Iterator iterator = anOrderItem.productionRuns
().iterator(); iterator
.hasNext();) {
ProductionRun aProductionRun = (ProductionRun)
iterator.next();
if (aProductionRun.deliveryDefect() != null)
deliveryDefects.addObject
(aProductionRun.deliveryDefect());
}
}

Now, I'm using WO 5.3 with java 1.5.0, so I assumed this should
work. But it fails due to iterator.hasNext() always returning
false. While debugging, I introduced the log statement that is
commented out above. With that in place, the iterator starts to
behave correctly!?

I'd really like to understand what's going on here! Is the
productionRuns() fault not getting fired by the iterator? Is this
intended/documented?

Now I'm back to using good old Enumeration which works w/o further
ado.

Any comments most welcome...

Fabian

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: Obtain the name of a server in WO

2006-09-09 Thread Lachlan Deck

Hi there,

On 09/09/2006, at 5:45 PM, Stephane Guyot wrote:

there is a non documented ( not yet public but perhaps in the  
future if Apple Open-souce WO :-) ) API on the WORequest  :  
public String _serverName()
WebObjects use it internally for the  isSecure bindings on the  
WOHyperlink


The thing about web applications (as opposed to consumerism which  
states that the customer is invariably right) is that you cannot  
trust or consistently rely upon the incoming request for the correct  
information. There is not one header that consistently gives you the  
correct information on an incoming request; besides which virtual  
hosting makes it impossible to ascertain the correct info from an ip  
address.


In summary: *You* need to decide what domain your application is  
served under. Configure this using the WOHost property and the  
WOCGIAdaptorURL as previously stated...


HTH

with regards,
--

Lachlan Deck



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


WO to go openSource?

2006-09-09 Thread .::welemski::.

Hi lists,

Is WebObjects really going to be openSource?
--
 -- -- -- -- -- -- -- -- -- -- --
 welemski
 -- -- -- -- -- -- -- -- -- -- --
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Re: Mysterious field not reachable from entity error

2006-09-09 Thread Matt Kime

it looks like there's some code you didn't show us. Are you using
this qualifier in a fetch specification somewhere?


Arg, yes. I found my problem. I was attempting to fetch rather than
filter based on the result of a method. Now I create an array of all
the objects and then filter them. Works fine.

Anyway, I'm now familiar with the difference between the two tools.
Many thanks to all that helped.

--matt
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: Session timeout and memory

2006-09-09 Thread Paul Lynch


On 9 Sep 2006, at 09:51, Ute Hoffmann wrote:

I would expect that when a session times out that then the used  
memory in this session is freed imediately... but I see in my  
memory logging that that seems not to be the case. Any idea what I  
need to start looking for? Or is this normal behaviour and the  
memory will be there when it is needed?


Succinctly: garbage collection.  Don't worry about it.

Paul
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: DB2 and WO

2006-09-09 Thread RedBugz Software

On 9/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hello -- does anybody use DB2 with WO5?  I can't see any adaptors out
there?  Has anybody had a crack at writing a JDBC adaptor for it?


We use DB2 for one of our WebObjects projects. We were just using the
normal JDBC stuff until we encountered a problem with LEFT OUTER JOIN
syntax and needed some additional non-JDBC DB2-only functionality, so
we ended up writing a small plugin to work around those. I don't think
I can publish the class, but I can give snippets. It was my first
attempt and probably not very good, but it worked for our needs.

We've not had luck with the pure-Java drivers, but that could easily
be a function of the strict nature of the DB2 database we access. The
native type-2 drivers work just fine, though they were a pain to
install and get working.

Logan
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Session timeout and memory

2006-09-09 Thread Ute Hoffmann

Hallo,
I would expect that when a session times out that then the used memory 
in this session is freed imediately... but I see in my memory logging 
that that seems not to be the case. Any idea what I need to start 
looking for? Or is this normal behaviour and the memory will be there 
when it is needed?


Regrads,

Ute

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: Obtain the name of a server in WO

2006-09-09 Thread Stephane Guyot

Gilles,

there is a non documented ( not yet public but perhaps in the future if  
Apple Open-souce WO :-) ) API on the WORequest  : public String  
_serverName()
WebObjects use it internally for the  isSecure bindings on the  
WOHyperlink



HTH,
Stephane


Le 9 sept. 06, à 05:27, Gilles MATHURIN a écrit :


Hello list,

After a few search in the WO documentations and experimentation, and  
owe to the people who send me clue and their way of doing,  i think i  
found a way to have the server name, yet i hope so.


I used the WOContext request() method. As u surely know (in fact i  
write this for the other newbie like me :-)) (WOContext context) is an  
argument of the constructor of ur WOComponent. So i wrote a few more  
line in it, to get what i want.


=== Example ===
At first u have this :

public MoviePage(WOContext context) {
super(context);
}
==

I added this :

 public MoviePage(WOContext context) {
super(context);
WORequest request = context.request();
String serverName = request.headerForKey("host");
		System.out.println("Server Name is :"+serverName); // For  
verification

}

==

after going to the MoviePage when i check the console i obtain this :
Server Name is : g-five.local.

That's what i should obtain. Then when i use the ivar serverName in a  
method who built a static URL like :


String dynamicVideoUrl = "http://"+serverName+"/folder/movie.mov";

the movie is displayed. Now i only hope that the server name is really  
the "apache domain name" (the static one). As the http server and the  
application server are on the same machine, it seems impossible to  
figure it out.


Maybe the more experienced WODeveloper could tell us ?

Regards.

GM.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ 
stephane.guyot11%40wanadoo.fr


This email sent to [EMAIL PROTECTED]



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com