[flexcoders] Location of Spring and LCDS - SpringFactory etc?

2007-10-31 Thread parkerwhirlow
Hi all,

We're begining a transition from pure DataManagementServices/Hibernate
to running our own DAOs/RPCs configured with spring.

Can someone point me to (or provide for everyone) the files for Spring
support in LCDS?

I've searched around on flexcoders, and seen several posts discussing
a SpringFactory for use with Flex (remoting and data management).
I've also seen a couple of I'll send updated SpringFactory code for
some work-arounds.

I was also able to find one spring support package on the flex
exchange here:
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetailextid=1035406

However, this package is said to be compatible with FDS 2.0.1. Isn't
there a new version compatible with the latest LCDS (2.5.1)?

Thanks in advance,
Parker Whirlow



[flexcoders] Channel.Polling.Error - Using DataService with AtuoCommit and AtutoSync

2007-04-27 Thread parkerwhirlow

Hi 

I seem to be getting intermittent faults from my data service. Trying
the same thing again seems to have it go away.

Using DataService w/ HibernateAssembler. AutoSync and AutoCommit are
enabled. Destination is configured with the default 'my-polling-amf'
channel.

see the fault below:
[FaultEvent fault=[RPC Fault faultString=error
faultCode=Channel.Polling.Error faultDetail=null]
messageId=D716AD65-B6ED-EDDD-89A8-342B42108D28 type=fault
bubbles=false cancelable=true eventPhase=2]


Any ideas? Is there a way to retry the operation from the fault handler?

thanks,
Parker Whirlow




[flexcoders] Fault events with DataService - Retry operation?

2007-04-24 Thread parkerwhirlow
Hi all,

I am not sure if it is JUST the network (WAN/Internet), or if there
are strange inconsistencies with FDS and the DataService, but here and
there sometimes I get back Fault events.

I get faultCode:=Channel.Polling.Error faultDetail:null
and faultCode=Channel.Call.Failed
faultDetail=NetConnection.Call.Failed: HTTP: Failed

inconsistently.

Is there a way to handle these faults, and tell the DataService to
retry? even better is an auto-retry counter...?

Any info on those errors and what could cause them, being that they're
inconsistent?

thanks,
Parker Whirlow




[flexcoders] Re: Setting DataGridColumn width programmatically visibleColumns

2007-04-19 Thread parkerwhirlow
So, I'm finding that this is really a nasty bug, and I haven't found a
good work-around.

I've tried searching through the DataGrid.columnMap to ensure there's
renderers for my column before setting the width. This works until you
scroll horizontally. The columns that used to be visible, but aren't
anymore still have renderers in columnMap... and as soon as you set
the width on a non-visible column, bam... null reference error.

I've submitted a bug report on Flex 2.0.1 through the normal feedback
channel.

Still looking for some kind of work-around if anyone knows of one, I
really need something!

thanks,
PW

--- In flexcoders@yahoogroups.com, parkerwhirlow [EMAIL PROTECTED]
wrote:

 Hi,
 
 I have an issue where I've created a special routine to calculate the
  size of the columns in my DataGrid subclass. 
 
 The problem I have is that I have several data grids that interact
 with eachother, and not all columns are visible (or were ever visible). 
 
 When I programmatically set the width of the columns, if the columns
 have not been shown (are not in the 'visibleColumns' array) I get a
 null pointer error. See the stack trace below.
 
 Since I can't get to the 'visibleColumns' collection, how can I set
 the 'desired' widths of my columns without running into this error?
 
 Also, looking at the actual code, they tried to check for some timing
 on whether they had calc'd columns. But they don't check if the column
 you're setting the width on is in the 'visibleColumns' list. This
 seems like a relatively simple defect to fix... It should fall into
 that upper if block, and set the width on the column itself, right?
 
 
 thanks,
 Parker Whirlow
 __
 
 TypeError: Error #1010: A term is undefined and has no properties.
 at

mx.controls::DataGrid/http://www.adobe.com/2006/flex/mx/internal::resizeColumn()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\DataGrid.as:2462]
 at mx.controls.dataGridClasses::DataGridColumn/set

width()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\dataGridClasses\DataGridColumn.as:1048]
 at

company.visualizations::MyGrid/company.visualizations:MyGrid::setDefaultColumnWidths()[C:\work\Flex\src\company\visualizations\MyGrid.as:1720]
 
 _
 source at DataGrid:2462
 
 // there's a window of time before we calc columnsizes
 // that someone can set width in AS
 if (!visibleColumns || visibleColumns.length == 0)
 {
   columns[col].setWidth(w);
   return;
 }
 
 if (w  visibleColumns[col].minWidth)   // ERROR IS HERE
   w = visibleColumns[col].minWidth;





[flexcoders] Re: Setting DataGridColumn width programmatically visibleColumns

2007-04-19 Thread parkerwhirlow
Ben,

No problem. I appreciate the thought and the response.

The column's 'visible' property only states whether the column should
be shown, not whether it is currently visible on the screen (I.E. a
column that is scrolled off the edge of the data grid is not visible
even though it's 'visible' property is true)

I believe the column's visible property relates to the DataGrid's
private list 'displayableColumns'
/**
 *  @private
 *  Columns with visible=true
 */
private var displayableColumns:Array;

and the DataGrid's 'visibleColumns' list are ones that are actually
visible to the user.

Anyway, I think I have a relatively OK workaround for now, I just put
a try/catch block around the call, and ignore any errors... its
working so far. =)

thanks,
PW


--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 Sorry if I am being really dense but I take it you can't just check
 the visible property of the column?
 
 Ben
 
 
 --- In flexcoders@yahoogroups.com, parkerwhirlow parkerwhirlow@
 wrote:
 
  So, I'm finding that this is really a nasty bug, and I haven't found a
  good work-around.
  
  I've tried searching through the DataGrid.columnMap to ensure there's
  renderers for my column before setting the width. This works until you
  scroll horizontally. The columns that used to be visible, but aren't
  anymore still have renderers in columnMap... and as soon as you set
  the width on a non-visible column, bam... null reference error.
  
  I've submitted a bug report on Flex 2.0.1 through the normal feedback
  channel.
  
  Still looking for some kind of work-around if anyone knows of one, I
  really need something!
  
  thanks,
  PW
  
  --- In flexcoders@yahoogroups.com, parkerwhirlow parkerwhirlow@
  wrote:
  
   Hi,
   
   I have an issue where I've created a special routine to
calculate the
size of the columns in my DataGrid subclass. 
   
   The problem I have is that I have several data grids that interact
   with eachother, and not all columns are visible (or were ever
 visible). 
   
   When I programmatically set the width of the columns, if the columns
   have not been shown (are not in the 'visibleColumns' array) I get a
   null pointer error. See the stack trace below.
   
   Since I can't get to the 'visibleColumns' collection, how can I set
   the 'desired' widths of my columns without running into this error?
   
   Also, looking at the actual code, they tried to check for some
timing
   on whether they had calc'd columns. But they don't check if the
column
   you're setting the width on is in the 'visibleColumns' list. This
   seems like a relatively simple defect to fix... It should fall into
   that upper if block, and set the width on the column itself, right?
   
   
   thanks,
   Parker Whirlow
   __
   
   TypeError: Error #1010: A term is undefined and has no properties.
   at
  
 

mx.controls::DataGrid/http://www.adobe.com/2006/flex/mx/internal::resizeColumn()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\DataGrid.as:2462]
   at mx.controls.dataGridClasses::DataGridColumn/set
  
 

width()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\dataGridClasses\DataGridColumn.as:1048]
   at
  
 

company.visualizations::MyGrid/company.visualizations:MyGrid::setDefaultColumnWidths()[C:\work\Flex\src\company\visualizations\MyGrid.as:1720]
   
   _
   source at DataGrid:2462
   
   // there's a window of time before we calc columnsizes
   // that someone can set width in AS
   if (!visibleColumns || visibleColumns.length == 0)
   {
 columns[col].setWidth(w);
 return;
   }
   
   if (w  visibleColumns[col].minWidth)   // ERROR IS HERE
 w = visibleColumns[col].minWidth;
  
 





[flexcoders] Setting DataGridColumn width programmatically visibleColumns

2007-04-18 Thread parkerwhirlow
Hi,

I have an issue where I've created a special routine to calculate the
 size of the columns in my DataGrid subclass. 

The problem I have is that I have several data grids that interact
with eachother, and not all columns are visible (or were ever visible). 

When I programmatically set the width of the columns, if the columns
have not been shown (are not in the 'visibleColumns' array) I get a
null pointer error. See the stack trace below.

Since I can't get to the 'visibleColumns' collection, how can I set
the 'desired' widths of my columns without running into this error?

Also, looking at the actual code, they tried to check for some timing
on whether they had calc'd columns. But they don't check if the column
you're setting the width on is in the 'visibleColumns' list. This
seems like a relatively simple defect to fix... It should fall into
that upper if block, and set the width on the column itself, right?


thanks,
Parker Whirlow
__

TypeError: Error #1010: A term is undefined and has no properties.
at
mx.controls::DataGrid/http://www.adobe.com/2006/flex/mx/internal::resizeColumn()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\DataGrid.as:2462]
at mx.controls.dataGridClasses::DataGridColumn/set
width()[C:\dev\flex_201_gmc\sdk\frameworks\mx\controls\dataGridClasses\DataGridColumn.as:1048]
at
company.visualizations::MyGrid/company.visualizations:MyGrid::setDefaultColumnWidths()[C:\work\Flex\src\company\visualizations\MyGrid.as:1720]

_
source at DataGrid:2462

// there's a window of time before we calc columnsizes
// that someone can set width in AS
if (!visibleColumns || visibleColumns.length == 0)
{
  columns[col].setWidth(w);
  return;
}

if (w  visibleColumns[col].minWidth)   // ERROR IS HERE
  w = visibleColumns[col].minWidth;





[flexcoders] Re: Odd behavior when calling DataService.getItem for multiple items.

2007-04-16 Thread parkerwhirlow
Thanks Jeff this worked.

This use of toString for generating a key, is this documented
somewhere that I missed? If not, I'd like to request that a small
paragraph be added that describes the requirements/behaviors of
identity properties when used with Data-Management... are there other
places I should be aware of that use toString as a key?

thanks,
PW

--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 For the AS class, try implementing a toString():String method which
 returns a unique identity from the composite id object.   Data
 management uses this to build a key to store the items in the cache. 
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Thursday, April 12, 2007 7:29 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Odd behavior when calling DataService.getItem for
 multiple items.
 
  
 
 
 I'm using the same DataService repeatedly in my Cairngorm delegates,
 and calling getItem() as needed to get items. 
 
 I'm using the call token to add a responder, and the strange thing is
 that in the result method of the responder, the event.result property
 is the SAME instance each time with the new object properties in it.
 
 Somehow the instance returned in event.result is re-used across calls
 to getItem. This causes all my items to end up being the same one!
 (whatever the most recent one fetched is)
 
 One thing that may be affecting this (not sure though) is that the ID
 property of my item (and DataService destination) is a typed object.
 This is because the item has a composite primary key, and I've
 implemented the recommended Components as composite identifiers
 method as advocated by the Hibernate guide:
 http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#component
 s-compositeid
 http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#componen
 ts-compositeid 
 
 I have set the destination ID type attribute as follows also:
 metadata
 identity property=id type=app.preferences.PrefIDVO/
 /metadata
 
 Looking at the event.message.body[0], I can see a different (unique)
 instance of the item... and strange thing is, the event.result
 instance and the event.message.body[0] instance share the SAME
 instance of the id property!
 
 Any ideas? See sample code below
 thanks,
 Parker Whirlow
 
 item delegate_
 
 public function getItemPreference(itemID:String):AsyncToken
 {
 var service:DataService =
 DataServiceManager.getInstance().getService(DataServiceManager.CONFIG_SE
 RVICE_PREF);
 
 // create the ID object (ID is combination of user and item)
 var iid:PrefIDVO = new PrefIDVO();
 iid.userID = SecurityManager.getInstance().userPrincipal;
 iid.itemID = itemID;
 
 var call:AsyncToken = service.getItem({ id: iid });
 call.iid=iid;
 call.addResponder(responder);
 
 return call;
 }
 
 item responder_
 
 protected function getItemPrefResult(event:ResultEvent):void
 {
 // get the item pref. (this is always the same object instance!)
 // why does this same instance keep getting updated 
 // with the newly fetched object properties?!?
 var pref:PrefVO = event.result as PrefVO;
 ...
 }





[flexcoders] Odd behavior when calling DataService.getItem for multiple items.

2007-04-12 Thread parkerwhirlow

I'm using the same DataService repeatedly in my Cairngorm delegates,
and calling getItem() as needed to get items. 

I'm using the call token to add a responder, and the strange thing is
that in the result method of the responder, the event.result property
is the SAME instance each time with the new object properties in it.

Somehow the instance returned in event.result is re-used across calls
to getItem. This causes all my items to end up being the same one!
(whatever the most recent one fetched is)

One thing that may be affecting this (not sure though) is that the ID
property of my item (and DataService destination) is a typed object.
This is because the item has a composite primary key, and I've
implemented the recommended Components as composite identifiers
method as advocated by the Hibernate guide:
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#components-compositeid

I have set the destination ID type attribute as follows also:
metadata
  identity property=id type=app.preferences.PrefIDVO/
/metadata


Looking at the event.message.body[0], I can see a different (unique)
instance of the item... and strange thing is, the event.result
instance and the event.message.body[0] instance share the SAME
instance of the id property!


Any ideas? See sample code below
thanks,
Parker Whirlow

item delegate_

public function getItemPreference(itemID:String):AsyncToken
{
var service:DataService =
DataServiceManager.getInstance().getService(DataServiceManager.CONFIG_SERVICE_PREF);

// create the ID object (ID is combination of user and item)
var iid:PrefIDVO = new PrefIDVO();
iid.userID = SecurityManager.getInstance().userPrincipal;
iid.itemID = itemID;

var call:AsyncToken = service.getItem({ id: iid });
call.iid=iid;
call.addResponder(responder);

return call;
}

item responder_

protected function getItemPrefResult(event:ResultEvent):void
{
// get the item pref. (this is always the same object instance!)
// why does this same instance keep getting updated 
// with the newly fetched object properties?!?
var pref:PrefVO = event.result as PrefVO;
...
}




[flexcoders] Chart Series - formatDataTip inconsistent visibility

2007-02-22 Thread parkerwhirlow

I started making some application specific tweaks to the chart series
dataTips, and it worked beautifully for ColumnSet (override the
protected function formatDataTip), but then I soon realized that only
the SET series (subclasses of StackedSeries) have that function as
protected. It's actually private on all the standard series.

Is there a reason that it's private on the normal series, but
protected on the series sets?

I am thinking as a workaround, I'll have to do something like this.
what do you think?

Use the chart's dataTipFunction, and call back into the series (via
hitData.element) to a slightly differently named function
(myFormatDataTip) defined on the series subclass. I don't like this
because then I have to make sure the myFormatDataTip function exists
before calling it, and I make assumption about the signature, but I
think that would work...

comments?
thanks,
PW




[flexcoders] Re: Chart Series - formatDataTip inconsistent visibility

2007-02-22 Thread parkerwhirlow
Ely,

Thanks for the info.

The reason I was going with subclasses, is because the Stacked type
series stacking information (stackTotals) is protected, so I needed a
subclass.

This whole thing started with the Stacked type series, the simple
series could possibly be handled in a single case statement. However,
since I have to use a subclass/override dataTipFunction for that, I am
kinda stuck going the subclass route right? Is there some way to do
the chart dataTipFunction and also in some cases use the series
supplied function?


In general, It seems like I find a lot of cases where it seems
completely unnecessary to make a function or variable protected or
private. I mean in the case of formatDataTip, that function does not
modify anything, simply formats a string. That could have been public
even. no danger of calling, and useful for calling or overriding.

If it were public, it would be easy to use the case statement, supply
the default formatDataTip function in the default case, and override
just the ones I wanted to. And if I could have gotten to the stack
totals that would have been just as good or even better.

thanks,
PW

--- In flexcoders@yahoogroups.com, Ely Greenfield [EMAIL PROTECTED] wrote:

  
  
 In general, they're prive because we provide an alternate method for
 changing the datatip that doesn't require subclassing (setting the
 dataTipFunction on the chart).
  
 Depending on the scenario, it feels a little bit like overkill. If I
 were writing this myself, I would write my own dataTipFunction for the
 chart, which just cased on the type of the series generating the
 datatip, and took appropriate action. The only reason I would bother
 with subclassing the series is if I were trying to wrap up new or
 modified series types for use in other apps or by other developers.  
  
 If you really want to keep the datatip functionality encapsulated in the
 series...The way datatips work is that the series stuffs a reference to
 its datatip function into the HitData structure before it returns it
 from the findDataPoints() function.  So I would subclass the series,
 override findDataPoints, call the super() version, and then right before
 returning the hitData structures generated by the super version, stuff
 my own altenrate data tip function into the hitData structures.
  
 Ely.
  
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Thursday, February 22, 2007 12:59 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Chart Series - formatDataTip inconsistent
 visibility
 
 
 
 
 I started making some application specific tweaks to the chart series
 dataTips, and it worked beautifully for ColumnSet (override the
 protected function formatDataTip), but then I soon realized that only
 the SET series (subclasses of StackedSeries) have that function as
 protected. It's actually private on all the standard series.
 
 Is there a reason that it's private on the normal series, but
 protected on the series sets?
 
 I am thinking as a workaround, I'll have to do something like this.
 what do you think?
 
 Use the chart's dataTipFunction, and call back into the series (via
 hitData.element) to a slightly differently named function
 (myFormatDataTip) defined on the series subclass. I don't like this
 because then I have to make sure the myFormatDataTip function exists
 before calling it, and I make assumption about the signature, but I
 think that would work...
 
 comments?
 thanks,
 PW





[flexcoders] Re: Chart Series - formatDataTip inconsistent visibility

2007-02-22 Thread parkerwhirlow
--- In flexcoders@yahoogroups.com, Ely Greenfield [EMAIL PROTECTED] wrote:
 In this scenario, I would suggest subclassing the Stacked series
 (ColumnSet, or whichever you need), and exposing the percent values.

OK, this seems workable to me.

 i.e., if the behavior is defined, accessible, overridable,
 then it ties our hands in our ability to refactor code and functionality
 because someone might be relying on it. 

I hadn't thought about that aspect. I was considering the usefulness
of having the information, versus needing to protect the class
functionality.

thanks,
PW



[flexcoders] Re: FDS/Hibernate Sample of updating hierarchical list of values

2007-02-16 Thread parkerwhirlow
Thats very unfortunate. I'm getting farther and farther into hot water
not being able to reliably update our data model using Flex.

Last it was just wait for 2.0.1, there's a lot of Hibernate/FDS fixes
in it and now we're waiting for another unknown amount of time for
fixes we can only hope will help our situation.

I'm apologize, I understand it's not your fault, and I really
appreciate the insight you provide as to what can be causing our
problems, I'm just getting up to my neck in unsolved problems.

If you have any insight as to roughly when this next release could
occur, can you tip me off?

thanks,
PW

--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 I have finished making the changes and the use of the merge call seems
 to be a) much simpler and b) more robust than the way the current code
 works.   
 
  
 
 Unfortunately we've made enough changes to the code surrounding the
 HibernateAssembler so I can't just send you the updated file and have it
 work in FDS2.  It will be in an upcoming public beta but I don't think
 we've announced the dates on that.  
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Thursday, February 15, 2007 3:29 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: FDS/Hibernate Sample of updating hierarchical
 list of values
 
  
 
 Hey Jeff, just curious if you've got any updated HibernateAssembler
 code with some fixes? Any idea when this would be available?
 
 thanks,
 PW
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Jeff Vroom jvroom@ wrote:
 
  My apologies - this does look like a bug. I need to do more testing on
  this case myself, but I think one of the big problems here is that we
  are trying to do conflict detection on our own in the hibernate
  assembler's updateItem method. Unless you are using a strict isolation
  level in your DB (repeatable read or serializable) this is not going
 to
  be transactionally correct anyway since the DB version can be modified
  after we have executed the query and before we do our update. We
  probably should not be getting the server version at all... hibernate
  has its own optimistic concurrency support that we should be using if
 it
  is enabled. That is probably the only way to get atomic conflict
  detection without resorting to using those particularly slow isolation
  levels. 
  
  
  
  That would potentially get rid of the conflicting version of the item
 in
  the transaction. The other thing I need to look into is the merge
  method in hibernate. Seems like we should probably be using that in
 the
  updateItem method? I'll be working on this next week so will send out
  any updates I can to the code.
  
  
  
  Jeff
  
  
  
  
  
  From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 ] On
  Behalf Of parkerwhirlow
  Sent: Thursday, February 01, 2007 6:05 PM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
  Subject: [flexcoders] FDS/Hibernate Sample of updating hierarchical
 list
  of values
  
  
  
  
  Hi all,
  
  I have been tearing my hair out trying to get FDS/Hibernate to update
  a hierarchical list of values. Even the simplest of collection
  mappings in Hibernate cause various exceptions when trying to update.
  
  Before I post my details, does anyone have any examples of this that
  work? Has anyone ever even gotten this to work?
  
  I have two objects mapped in Hibernate:
  
  - Family
  Person
  
  where a Family has a Set of Person familyMembers.
  
  My FDS destination is to Family, and I am trying to update a family
  member (just the name) through this destination.
  
  First, I was getting Hibernate NonUniqueObjectException, which I
  finally tracked down to having my hibernate collection mapping set to
  lazy=false This caused all of the family member Person objects to be
  loaded into the PersistenceContext when the HibernateAssembler loaded
  the serverVersion of the Family. 
  
  Then, once I set lazy=true on the collection mapping, I was getting an
  exception that A collection with cascade=all-delete-orphan was no
  longer referenced by the owning entity instance... since it is
  assigning a whole new collection to the familyMembers property one
  becomes unreferenced, and the other referenced. Sooo I can't use
  delete orphan to delete the family members when the family is
  deleted... OK. So then I make cascade=all.
  
  Now I'm getting ORA-01407: cannot update
  (SCHEMA.T_PERSON.FAMILYID) to NULL... I'm guessing that it's
  processing the dereferenced collection first (trying to detatch any
  Person's from the family before they're re-attached by the new
  collection. I can't believe this is so difficult...
  
  For more info on my setup and test case, please see my original post

[flexcoders] FDS/Hibernate - LazyInitializationException when writing AMF output

2007-02-16 Thread parkerwhirlow
Hi again =)

I've just started getting this exception inconsistently... sometimes
it happens 3 times in a row, other times I can go all afternoon
without getting it. Once the exception occurs, it will occur every
time the client loads until FDS is restarted.

Note this occurs on multiple collections. I tried setting the
offending collection to lazy=false (in Hibernate), and the exception
occurred on a different collection. I can't set every one of  my
collections to lazy=false. Especially since at this point, they HAVE
to be lazy for the updateItem via hierarchical values to almost work.

I also noticed that the collection does not necessarily need to have
any  items in it. (And possibly is caused specifically by NOT having
any items in it, I can't tell for sure). The collection referenced in
the exception below has no values, and there's another collection in
that same class with values that doesn't seem to cause the exception.

See below the hibernate mapping, and exception output when this
occurs. (Note there are no FDS managed associations for this collection)

Thanks for any insight you have as to what is causing this.

PW
_


joined-subclass name=Adult table=T_ADULT extends=Person
key
column name=ID length=22 /
/key
set name=children 
inverse=false
cascade=all-delete-orphan 
key
   column name=PARENTID length=22 not-null=false /
/key
one-to-many class=Person /
/set
...
/joined-subclass


10:19:42,093  WARN ProxyWarnLog - Narrowing proxy to class
config.test.Adult - this operation breaks ==
10:19:44,687 ERROR LazyInitializationException - failed to lazily
initialize a collection of role: config.test.Adult.children, no
session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize
a collection of role: config.test.Adult.children, no session or
session was closed
at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.j
ava:350)
at
org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at
org.hibernate.collection.PersistentSet.size(PersistentSet.java:139)
at java.util.ArrayList.init(ArrayList.java:133)
at
flex.messaging.io.ArrayCollection.init(ArrayCollection.java:44)
at
flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:407)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:147)
at
flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
at
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
at
flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
at
flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:730)
at
flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:386)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:151)
at
flex.messaging.io.ArrayCollection.writeExternal(ArrayCollection.java:97)
at
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:485)
at
flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:414)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:147)
at
flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
at
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
at
flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
at
flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:730)
at
flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:386)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:151)
at
flex.messaging.io.ArrayCollection.writeExternal(ArrayCollection.java:97)
at
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:485)
at
flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:414)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:147)
at
flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
at
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
at
flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
at
flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
at
flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:730)
at
flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:386)
at

[flexcoders] Re: FDS/Hibernate - LazyInitializationException when writing AMF output

2007-02-16 Thread parkerwhirlow
This is happening from FDS... flex.data.assemblers.HibernateAssembler
uses a function called fetchObjectProperties() that's supposed to load
them all while the session is open right?

I've seen in other posts that FDS eager fetches the properties in the
Assembler, so that they are available during serialization... 

am I missing something here?

thanks,
PW



--- In flexcoders@yahoogroups.com, Dima Gutzeit [EMAIL PROTECTED] wrote:

 Hi,
 
 You have to initialize the collections before AMF serializes them. The 
 problem occurs since you closing Hibernate session without first 
 initializing the arrays, and since you are using lazy initialization
the 
 problem arise.
 
 You have two options :
 
 1. Use lazy=false
 2. Better one, is calling /Hibernate.initialize(your_array_reference);/ 
 before you close the Hibernate session.
 
 Regards,
 Dima Gutzeit.
 
 parkerwhirlow wrote:
 
  Hi again =)
 
  I've just started getting this exception inconsistently... sometimes
  it happens 3 times in a row, other times I can go all afternoon
  without getting it. Once the exception occurs, it will occur every
  time the client loads until FDS is restarted.
 
  Note this occurs on multiple collections. I tried setting the
  offending collection to lazy=false (in Hibernate), and the exception
  occurred on a different collection. I can't set every one of my
  collections to lazy=false. Especially since at this point, they HAVE
  to be lazy for the updateItem via hierarchical values to almost work.
 
  I also noticed that the collection does not necessarily need to have
  any items in it. (And possibly is caused specifically by NOT having
  any items in it, I can't tell for sure). The collection referenced in
  the exception below has no values, and there's another collection in
  that same class with values that doesn't seem to cause the exception.
 
  See below the hibernate mapping, and exception output when this
  occurs. (Note there are no FDS managed associations for this
collection)
 
  Thanks for any insight you have as to what is causing this.
 
  PW
  _
 
  joined-subclass name=Adult table=T_ADULT extends=Person
  key
  column name=ID length=22 /
  /key
  set name=children
  inverse=false
  cascade=all-delete-orphan 
  key
  column name=PARENTID length=22 not-null=false /
  /key
  one-to-many class=Person /
  /set
  ...
  /joined-subclass
 
  10:19:42,093 WARN ProxyWarnLog - Narrowing proxy to class
  config.test.Adult - this operation breaks ==
  10:19:44,687 ERROR LazyInitializationException - failed to lazily
  initialize a collection of role: config.test.Adult.children, no
  session or session was closed
  org.hibernate.LazyInitializationException: failed to lazily initialize
  a collection of role: config.test.Adult.children, no session or
  session was closed
  at
 
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
  at
 
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.j
  ava:350)
  at
 
org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
  at
  org.hibernate.collection.PersistentSet.size(PersistentSet.java:139)
  at java.util.ArrayList.init(ArrayList.java:133)
  at
  flex.messaging.io.ArrayCollection.init(ArrayCollection.java:44)
  at
 
flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:407)
  at
  flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:147)
  at
 
flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
  at
 
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
  at
 
flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
  at
  flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
  at
  flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:730)
  at
  flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:386)
  at
  flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:151)
  at
 
flex.messaging.io.ArrayCollection.writeExternal(ArrayCollection.java:97)
  at
 
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:485)
  at
 
flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:414)
  at
  flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:147)
  at
 
flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
  at
 
flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
  at
 
flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
  at
  flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
  at
  flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:730)
  at
  flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:386)
  at
  flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:151

[flexcoders] Re: FDS/Hibernate Sample of updating hierarchical list of values

2007-02-15 Thread parkerwhirlow
Hey Jeff, just curious if you've got any updated HibernateAssembler
code with some fixes? Any idea when this would be available?

thanks,
PW

--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 My apologies - this does look like a bug.   I need to do more testing on
 this case myself, but I think one of the big problems here is that we
 are trying to do conflict detection on our own in the hibernate
 assembler's updateItem method.  Unless you are using a strict isolation
 level in your DB (repeatable read or serializable) this is not going to
 be transactionally correct anyway since the DB version can be modified
 after we have executed the query and before we do our update.   We
 probably should not be getting the server version at all... hibernate
 has its own optimistic concurrency support that we should be using if it
 is enabled.   That is probably the only way to get atomic conflict
 detection without resorting to using those particularly slow isolation
 levels.  
 
  
 
 That would potentially get rid of the conflicting version of the item in
 the transaction.  The other thing I need to look into is the merge
 method in hibernate.  Seems like we should probably be using that in the
 updateItem method?   I'll be working on this next week so will send out
 any updates I can to the code.
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Thursday, February 01, 2007 6:05 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] FDS/Hibernate Sample of updating hierarchical list
 of values
 
  
 
 
 Hi all,
 
 I have been tearing my hair out trying to get FDS/Hibernate to update
 a hierarchical list of values. Even the simplest of collection
 mappings in Hibernate cause various exceptions when trying to update.
 
 Before I post my details, does anyone have any examples of this that
 work? Has anyone ever even gotten this to work?
 
 I have two objects mapped in Hibernate:
 
 - Family
 Person
 
 where a Family has a Set of Person familyMembers.
 
 My FDS destination is to Family, and I am trying to update a family
 member (just the name) through this destination.
 
 First, I was getting Hibernate NonUniqueObjectException, which I
 finally tracked down to having my hibernate collection mapping set to
 lazy=false This caused all of the family member Person objects to be
 loaded into the PersistenceContext when the HibernateAssembler loaded
 the serverVersion of the Family. 
 
 Then, once I set lazy=true on the collection mapping, I was getting an
 exception that A collection with cascade=all-delete-orphan was no
 longer referenced by the owning entity instance... since it is
 assigning a whole new collection to the familyMembers property one
 becomes unreferenced, and the other referenced. Sooo I can't use
 delete orphan to delete the family members when the family is
 deleted... OK. So then I make cascade=all.
 
 Now I'm getting ORA-01407: cannot update
 (SCHEMA.T_PERSON.FAMILYID) to NULL... I'm guessing that it's
 processing the dereferenced collection first (trying to detatch any
 Person's from the family before they're re-attached by the new
 collection. I can't believe this is so difficult...
 
 For more info on my setup and test case, please see my original post:
 http://tech.groups.yahoo.com/group/flexcoders/message/63308
 http://tech.groups.yahoo.com/group/flexcoders/message/63308 
 
 any comments as to if anyone has done this successfully are greatly
 appreciated!
 
 thanks,
 PW





[flexcoders] Re: FDS DataService.commit() doesn't trigger responder result()...?

2007-02-12 Thread parkerwhirlow
Jeff, 

Sorry about the lack of response, I've been out of the office all last
week.

I haven't heard of this mx:TraceTarget/ is that a global flag you
put at the mx:Application level? I'll give it a shot, and get back to you.

thanks,
PW

--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 It does really look like the ack is going back to the client.  Have you
 tried looking at the client side logs (in flashlog.txt, debug player
 only, enabled with mx:TraceTarget/?  Maybe something funky is going on
 there?
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Monday, February 05, 2007 11:15 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] FDS DataService.commit() doesn't trigger responder
 result()...?
 
  
 
 Hi again,
 
 I've got a simple save case working as far as I can tell (from
 debugging the server java side, everything is OK after leaving the
 HibernateAssembler.java updateItem() method.
 
 But the result never gets back to the client... I have a responder
 registered to the call like so:
 
 call = service.commit();
 call.action = save;
 call.addResponder(responder);
 
 And my responder has both fault and result methods. I know the
 responder is registered because I was getting faults for a long time,
 and those were firing the fault handler. But now that I think I have
 the save going successfully, I'm not getting anything back.
 
 I've turned on FDS logging for messages, see the trace below. Seems
 like the ACK message is being sent... 
 
 Any ideas?
 
 thanks,
 PW
 
 02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG]
 [Message.Data.transacted] After invoke service: data-service
 reply: Flex Message (flex.messaging.messages.AcknowledgeMessage)
 clientId = null
 correlationId = null
 destination = null
 messageId = 7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5
 timestamp = 1170702096794
 timeToLive = 0
 body =
 [
 
 ]
 
 02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG] [Endpoint.RTMP]
 Serializing AMF/RTMP response
 Version: 3
 (Command method=_result (0) trxId=20)
 (Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
 destination = null
 headers = (Object #1)
 correlationId = 322C326C-9C96-8513-7EC3-934715E5D887
 messageId = 7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5
 timestamp = 1.170702096794E12
 clientId = 77909013-D108-A13B-EC7E-EDBFA5C3A894
 timeToLive = 0.0
 body = (Array #2)





[flexcoders] Re: parent-child hierarchy of data using Flex, FDS and Hibernate

2007-02-12 Thread parkerwhirlow

 All-in-all a very worthwhile exercise and my dev environment is now
 more under my control.

Good to hear. was just replying to your previous post in this thread,
and now I see you got it figured out. Excellent.

 
 I still can't figure out how to turn on debug logging in Hibernate,

See this other post where I figured out how to turn on the Hibernate
logging. If you don't know about log4j, I suggest doing a few searches
on it, and reading up about the log4j.properties file. It's a very
powerful tool, and Hibernate has a TON of good logging, but its easy
to get lost in it all if you just turn everything on to debug...

http://tech.groups.yahoo.com/group/flexcoders/message/59623

Hibernate has a sample log4j.properties in the Hibernate/etc directory



 The exception is thrown way down in the bowels of the Hibernate
 session.save() method which is being called by
 HibernateAssembler.createItem.  From Jeff's last post he seemed to be
 suggesting that updateItem was in some way at fault.  I'm not quite
 seeing how that relates to my problem, although I am clearly no expert.
 

I'm not exactly sure how the problem would occur from createItem(),
but take a look at my post here I mention what was causing it for me
(was a lazy=false setting on the collection association of the object
being updated)

http://tech.groups.yahoo.com/group/flexcoders/message/63471

The issue with the NOT NULL column was that once I had everything
working the behavior it was doing was to null out all the FK values
for the association, thereby dis-associating the children from the
parent, then updating all the entries in the collection to point back
to the parent. Once I made the association nullable, the update
started working. (at least as far as FDS was concerned.


 
 Jeff, if you have a new version of the Assembler code and want a
 guinea-pig, send it my way.
 

Likewise!

cheers,
PW




[flexcoders] Re: parent-child hierarchy of data using Flex, FDS and Hibernate

2007-02-12 Thread parkerwhirlow
--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:
 It is now trying
 to do conflict detection on its own by comparing the previous version
 with a version of the hibernate object it loads into that session.  That
 won't be transactionally correct unless you are using a strict isolation
 level and Hibernate has its own versioning stuff which we should be
 using instead.   

Just an FYI, I have turned off all UPDATE conflict detection in FDS
(update-conflict-modeNONE/update-conflict-mode) in an attempt to
get the simple case working. I am fine with using Hibernate's
versioning for conflict detection. 

PW



[flexcoders] FDS DataService.commit() doesn't trigger responder result()...?

2007-02-05 Thread parkerwhirlow
Hi again,

I've got a simple save case working as far as I can tell (from
debugging the server java side, everything is OK after leaving the
HibernateAssembler.java updateItem() method.

But the result never gets back to the client... I have a responder
registered to the call like so:

call = service.commit();
call.action = save;
call.addResponder(responder);

And my responder has both fault and result methods. I know the
responder is registered because I was getting faults for a long time,
and those were firing the fault handler. But now that I think I have
the save going successfully, I'm not getting anything back.

I've turned on FDS logging for messages, see the trace below. Seems
like the ACK message is being sent... 

Any ideas?

thanks,
PW


02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG]
[Message.Data.transacted] After invoke service: data-service
  reply: Flex Message (flex.messaging.messages.AcknowledgeMessage)
clientId = null
correlationId = null
destination = null
messageId = 7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5
timestamp = 1170702096794
timeToLive = 0
body =
[

]

02/05 11:01:36 user [Flex] 11:01:36.794 [DEBUG] [Endpoint.RTMP]
Serializing AMF/RTMP response
Version: 3
  (Command method=_result (0) trxId=20)
(Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
  destination = null
  headers = (Object #1)
  correlationId = 322C326C-9C96-8513-7EC3-934715E5D887
  messageId = 7793A2C0-FA0D-5A78-3641-BB1BA4B4ADB5
  timestamp = 1.170702096794E12
  clientId = 77909013-D108-A13B-EC7E-EDBFA5C3A894
  timeToLive = 0.0
  body = (Array #2)




[flexcoders] Re: FDS/Hibernate Sample of updating hierarchical list of values

2007-02-02 Thread parkerwhirlow
Jeff, thanks for looking into this...

while you're at it, I posted this as a bug to the wishlist site, but
it didn't make it into 2.0.1... I've taken to building the
HibernateAssembler myself to try to get things working, but this is
dedfinitely a defect:

HibernateAssembler.java (fds2.0.1 release version)
Line (starting): 691

int k;
for (k = i; k  toList.size(); k++)
{
  if (assocType.getIdentityFromItem(toList.get(i)).equals(fromId))
  break;
}

Notice that the index used in the loop is (i) not (k)... this was
causing some really odd behavior that took me a good while to figure
out =)

thanks again,
PW


--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 My apologies - this does look like a bug.   I need to do more testing on
 this case myself, but I think one of the big problems here is that we
 are trying to do conflict detection on our own in the hibernate
 assembler's updateItem method.  Unless you are using a strict isolation
 level in your DB (repeatable read or serializable) this is not going to
 be transactionally correct anyway since the DB version can be modified
 after we have executed the query and before we do our update.   We
 probably should not be getting the server version at all... hibernate
 has its own optimistic concurrency support that we should be using if it
 is enabled.   That is probably the only way to get atomic conflict
 detection without resorting to using those particularly slow isolation
 levels.  
 
  
 
 That would potentially get rid of the conflicting version of the item in
 the transaction.  The other thing I need to look into is the merge
 method in hibernate.  Seems like we should probably be using that in the
 updateItem method?   I'll be working on this next week so will send out
 any updates I can to the code.
 
  
 
 Jeff
 




[flexcoders] Re: parent-child hierarchy of data using Flex, FDS and Hibernate

2007-02-01 Thread parkerwhirlow
Hi guys,

I have made a post in similar vein to this one, and had a couple
comments.  I agree that when possible, using managed associations and
individual destinations for each side of the association is a best
approach. However I'm running into issues with the hierarchical
values approach you mention below. Maybe it's just my hibernate
mappings, or maybe there's an issue. Note, I end up having to use this
approach in some cases (destination references a base-class, and
collection associations reside in sub-class instances).

In the example used here, whenever I modify a value of a child (User
Scenario) or grandchild (Scenario), because the save is going through
the parent (PlanPoint), the Hibernate Assembler assigns the collection
as though it were a property of the parent. At this point when the
commit occurs, I get a org.hibernate.NonUniqueObjectException: a
different object with the same identifier value was already associated
with the session

Check out my post.
(http://tech.groups.yahoo.com/group/flexcoders/message/63308) 

I'd be interested to know if you get this working (hierarchical
values), could you post up an example of the hibernate mappings?

thanks,
PW


--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 This relates to your other question about the association tags in the
 metadata section.  There are two ways you can work with non-primitive
 object properties using FDMS.  You can either have them be managed
 associations or you can treat them as hierarchical values.  If you
 choose the former, you define a destination for each data type and
 explicitly define the relationships using the metadata tags:
 one-to-many, one-to-one, etc (FDMS only pays attention to the ...-to-one
 or -to-many suffix as it only cares about whether the association is
 single or multi-valued).   In this approach, each destination deals with
 the changes made to objects of that type.  If you create a new child
 object and add it to a property on the parent for example, it will send
 the create event to the child destination and then send an update event
 to the parent destination.  These are both executed in the same
 transaction so they will both get committed at the same time.  
 
  
 
 When you use the hierarchical values approach, the entire object graph
 underneath that property is treated as a single value.  Any changes made
 to any state under that property is treated as a change to the
 property's value.  FDMS reports the change to the parent object's
 destination and only tells you that the property of the parent changed.
 We do give you the complete old and new values though of the parent
 object so you can walk down and compare them to figure out the details
 of what changed.   Whenever you use this approach, the entire object
 graph gets shipped back and forth for each change so it gets inefficient
 as the object graph gets bigger.  
 
  
 
 In this particular case, it sounds like the managed association feature
 would be the best approach.   You can create new objects on either the
 client or the server - whichever makes the most sense for your
 application.  Simply adding a new object to the property of another
 managed object is enough to create it for the system.  We'll detect
 that it is a new object and log both the create and update operations as
 part of the batch.  When you issue the commit call, both are sent to
 the server as part of the same batch.
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of simonjpalmer
 Sent: Sunday, January 28, 2007 12:56 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] parent-child hierarchy of data using Flex, FDS and
 Hibernate
 
  
 
 Hi,
 
 I have a 4 level hierarchy of data in my application with a
 bi-directional one-to-many relationship between each level as follows:
 
 PlanPoint (parent)
 -- UserScenario (child)
  Scenario (grandchild)
 -- Competitor (great grandchild)
 
 I have a hibernate back end running under JBoss and I am using FDS to
 synchronise the changes from my Flex UI. My DB will be Oracle, but
 for the time being I am just testing with a HSQLDB for convenience.
 
 I have managed to create a destination in FDS which will retrieve the
 parent objects. The hibernate mapping docs specify the further
 retrieval of the graph of objects attached to them. This all works
 fine and performs reasonably well, although I have been unable to get
 any meaningful lazy loading to work (a problem for another time).
 
 My problem comes in that the user will interact deeply with the graph
 of objects during the client session. This includes adding, removing
 and updating objects at all levels.
 
 What I can't seem to get right is the interaction in the Flex layer
 which copes with this level of interaction.
 
 For instance if I want to add a new Competitor to a Scenario do I 
 (i) create all new objects on the client and then synchronise the
 

[flexcoders] FDS/Hibernate Sample of updating hierarchical list of values

2007-02-01 Thread parkerwhirlow

Hi all,

I have been tearing my hair out trying to get FDS/Hibernate to update
a hierarchical list of values. Even the simplest of collection
mappings in Hibernate cause various exceptions when trying to update.

Before I post my details, does anyone have any examples of this that
work? Has anyone ever even gotten this to work?

I have two objects mapped in Hibernate:

- Family
Person

where a Family has a Set of Person familyMembers.

My FDS destination is to Family, and I am trying to update a family
member (just the name) through this destination.

First, I was getting Hibernate NonUniqueObjectException, which I
finally tracked down to having my hibernate collection mapping set to
lazy=false This caused all of the family member Person objects to be
loaded into the PersistenceContext when the HibernateAssembler loaded
the serverVersion of the Family. 

Then, once I set lazy=true on the collection mapping, I was getting an
exception that A collection with cascade=all-delete-orphan was no
longer referenced by the owning entity instance... since it is
assigning a whole new collection to the familyMembers property one
becomes unreferenced, and the other referenced. Sooo I can't use
delete orphan to delete the family members when the family is
deleted... OK. So then I make cascade=all.

Now I'm getting ORA-01407: cannot update
(SCHEMA.T_PERSON.FAMILYID) to NULL... I'm guessing that it's
processing the dereferenced collection first (trying to detatch any
Person's from the family before they're re-attached by the new
collection. I can't believe this is so difficult...

For more info on my setup and test case, please see my original post:
http://tech.groups.yahoo.com/group/flexcoders/message/63308

any comments as to if anyone has done this successfully are greatly
appreciated!

thanks,
PW




[flexcoders] FDS save problem w/Hibernate collection

2007-01-31 Thread parkerwhirlow

Hello,

I'm getting back a Hibernate NonUniqueObjectException when trying to
update an item via FDS. This happens (as far as I can tell) any time
you update a property of an object in a collection that is NOT a
managed association in FDS.

Here's the details: 

Single FDS destination: Family 

Family has a set of familyMembers (no FDS managed association,
one-to-many set w/class Person in Hibernate). Hibernate set up to
commit via the collection (inverse=false, cascade=ALL_CASCADE_DELETE)

Load a family, iterate through the familyMembers, and change one of
their names. 

I've tried this with auto-commit and manual commit, both with same
results.

stack trace and code follow. Please let me know, I can email an entire
setup for easily reproducing this.

Thanks in advance,
PW

-- Stack Trace ---

01/31 14:16:51 user [Flex] 14:16:51.403 [ERROR]
[DataService.Hibernate] Exception in UpdateItem:
org.hibernate.NonUniqueObjectException: a different object with the
same identifier value was already associated with the session:
[config.test.Person#3]
01/31 14:16:51 user [Flex] 14:16:51.413 [ERROR]
[DataService.Hibernate] org.hibernate.NonUniqueObjectException: a
different object with the same identifier value was already associated
with the session: [config.test.Person#3]
at
org.hibernate.engine.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:556)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:259)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:217)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
at
org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
at
org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
at
org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
at
org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
at
org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at
flex.data.assemblers.HibernateAssembler.updateItem(HibernateAssembler.java:740)
at flex.data.adapters.JavaAdapter.doUpdateItem(JavaAdapter.java:504)
at
flex.data.adapters.JavaAdapter.invokeAssemblerSync(JavaAdapter.java:391)
at
flex.data.adapters.JavaAdapter.invokeBatchOperation(JavaAdapter.java:248)
at flex.data.adapters.JavaAdapter.invoke(JavaAdapter.java:232)
at
flex.messaging.services.MessageService.serviceMessage(MessageService.java:139)
at flex.data.DataService.sendBatchToAdapter(DataService.java:1326)
at flex.data.DataService.serviceTransactedMessage(DataService.java:505)
at flex.data.DataService.serviceMessage(DataService.java:241)
at
flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:548)
at
flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:302)

- Hibernate Mappings -

class name=Family table=T_FAMILY 
id name=id type=string
column name=ID length=22 /
generator class=assigned /
/id
property name=familyName type=string
column name=SURNAME length=100 not-null=false /
/property
set name=familyMembers 
inverse=false lazy=false
cascade=all-delete-orphan
key
column name=FAMILYID length=22 not-null=true /
/key
one-to-many class=Person /
/set
/class

class name=Person table=T_PERSON 
id name=id type=string
column name=ID length=22 /
generator class=assigned /
/id
property name=name type=string
column name=NAME length=100 /
/property
many-to-one name=family 

[flexcoders] Re: Is Flash a single thread application?

2007-01-23 Thread parkerwhirlow
Events are not fired concurrently. They are fired in order of their
listener priority. See the following documentation on
addEventListener function
http://livedocs.macromedia.com/flex/2/langref/flash/events/EventDispatcher.html#addEventListener()

By default, priority is '0' for user added events, so they will fire
in the order added. There's some constants defined in the
EventPriority class that the framework uses when adding event
listeners for things such as Bindings, Effects, etc. 

Hope this helps.
PW

--- In flexcoders@yahoogroups.com, Cameron Bahan [EMAIL PROTECTED] wrote:

 Flash does seems to be single-threaded.  However, one should be  
 careful as events are fired concurrently.  I have run into a few  
 issues regarding concurrency and shared data.  So far the only  
 solutions that I have heard is to write a custom locker class using  
 a boolean lock.  Has anyone else experienced this?  How have you  
 solved it?
 
 CS Bahan
 Lead Software Engineer
 
 On Jan 23, 2007, at 4:31 AM, saha.prasanta wrote:
 
  Hi,
 
  I've read in some forum that Flash is a single thread application.
  I tried to find some document supporting that statement, But I
  couldn't find any document by Adobe or Macromedia regarding that.
 
  Could you plase help me by forwarding the of such article. I need that
  as a proof for one of my project.
 
  Warm regards,
 
  Prasanta Saha,
  Flash Developer,
  Hyderabad, Indaia
 
 
 





[flexcoders] Re: non visible fields in data grid are displaying

2007-01-23 Thread parkerwhirlow
I have seen other posts recently regarding this. Search for 2.0.1 in
recent past, and you'll find some others with this issue. I personally
have not seen it.

good luck,
PW

--- In flexcoders@yahoogroups.com, Shelley Browning
[EMAIL PROTECTED] wrote:

 Hello,
  
 I've been building an application that utilizes data grids.  For some
 reason the fields that are set visible=false are displaying when the
 data is populated using a data collection and data is updated. This just
 started occurring when I did the updated with Flex Builder.  Anyone else
 see this?  If so what did you do to correct?
  
 mx:DataGrid id=gridEmployees dataProvider={searchCollection}
 width=90% height=100%
   mx:columns
mx:DataGridColumn headerText=Emp No dataField=EmpNo
 width=60 /
mx:DataGridColumn headerText=Name dataField=Name /
mx:DataGridColumn headerText=Job Title dataField=JobTitle/
mx:DataGridColumn headerText=PersonID dataField=PersonID
 visible=false/
mx:DataGridColumn headerText=PersonUUID dataField=PersonUUID
 visible=false/
   /mx:columns
  /mx:DataGrid
  
 Thanks,
  
 Shelley Browning
 Intermountain Healthcare





[flexcoders] Constant 40% CPU usage in Flex App?

2007-01-23 Thread parkerwhirlow

Guys,

I just noticed that my application is constantly using around 40% of
my computer's CPU...  I have a decent (albeit old) 2Ghz machine with
2GB ram... 

This is long after the app has loaded everything and had time to
settle...

Are there any other people out there seeing strange issues where the
CPU hangs around 40%?

I'm starting into the debugger, trying to break into it while its
running to see what is going on... Can't really tell right now. One
thing I did see was, the BusyCursor::enterFrameHandler keeps getting
called even though I have ended the busy cursor using
CursorManager.removeBusyCursor. The busy cursor isn't showing any more
either... I don't know how often that enterFrameHandler is called.
Could that be part of the issue?

Looking for any ideas on how to troubleshoot this too. I have tried to
create somewhat simplified applications, but so far none can reproduce
the issue I have with the main app.

thanks,
PW



[flexcoders] Re: DataGrid - numeric sort?

2007-01-18 Thread parkerwhirlow
Thanks a bunch, 

That did work great. 
PW

--- In flexcoders@yahoogroups.com, michael_ramirez44
[EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, parkerwhirlow 
 parkerwhirlow@ wrote:
 
  DUDE! what the heck ?
  
  You must have copied out the labelFunction... thats not
  sortCompareFunction... it definitely requires two objects to 
 compare!
  
  Your example implementation even does a simple number format =)
  
  Nice try though.
  PW
  
  In the Language Reference, the only documentation for 
 sortCompareFunction
  
  --- In flexcoders@yahoogroups.com, michael_ramirez44
  michael_ramirez44@ wrote:
  
   --- In flexcoders@yahoogroups.com, parkerwhirlow 
   parkerwhirlow@ wrote:
   

Its amazing how complicated something so seemingly easy can 
 be...

All I want to do is provide a numeric sort for columns that 
 contain
numeric data. (by default the sorting is all text based)

I found the DataGridColumn.sortCompareFunction and tried this.

The problem I have is that the objects passed to the function 
 are 
   the
entire row, and I have no context of which column the sort is 
 for.

It seems like they left out some key information in the 
 signatures 
   of
some of the DataGrid functions... for instance labelFunction 
   signature
has the column being rendered but dataTipFunction does not. 
   Therefore
I have the same issue with dataTipFunction as I do with
sortCompareFunction... how do you know what column you're 
 working 
   with?

Anyone know any tricks? How have others implemented custom 
 sorting 
   of
datagrids?

thanks,
PW
   
   
   The signature on the SortCompareFunction:
   
   private function sortNumber
 (item:Object,column:DataGridColumn):String
   {
 return numFormatter.format(item[column.dataField]);
   }
  
 
 
 Sorry! Your right I gave you the labelFunction. For the 
 SortCompateFunction I had to capture the headerRelease event and 
 store the column that was sorted.
 
 mx:DataGrid id=dgResults dataProvider={results} width=100% 
 height=100% headerRelease=sortHeader(event) /
 
 private function sortHeader(event:DataGridEvent):void
 {
 columnToSort = event.dataField;
 }
 
 private function sortColumnNumber( x:Object, y:Object):int
 {
 x[columnToSort]  y[columnToSort]
 return ...
 }





[flexcoders] Flex 2.0.1 update install problems

2007-01-16 Thread parkerwhirlow

I just installed Flex Builder Plugin 2.0.1 Updater, and followed
install instructions, running eclipse -clean -vmargs -Xmx512m

Has anyone else seen this error?
I've searched flexcoders, and this problem appears to be unique.
thanks,
PW

When Flex starts up I get this error:

A problem occurred while opening this project. Try quitting and
restarting the application. If the problem persists, you may be using
an unsupported project version, or your project files may be corrupted.


In the Eclipse error log, I have this:

!SUBENTRY 1 com.adobe.flexbuilder.project 4 43 2007-01-16 09:24:58.617
!MESSAGE Error Loading Project
!STACK 0
com.adobe.flexbuilder.project.persist.PersistenceException: Expected a
single compilerSourcePath tag but found 0
at
com.adobe.flexbuilder.project.persist.TagSetting.getSingleElement(Unknown
Source)
at com.adobe.flexbuilder.project.persist.ClassPathSetting.read(Unknown
Source)
at com.adobe.flexbuilder.project.persist.ContainerTag.read(Unknown Source)
...





[flexcoders] Re: Flex 2.0.1 update problems - FIXED Cairngorm 2.0

2007-01-16 Thread parkerwhirlow
Deleting and re-creating each of my projects in turn revealed that it
was the Cairngorm 2.0 project that is imported into the workspace.

I also found the tags they're looking for and added them. Here's the
two that were missing from .actionScriptProperties  (add these tags
inside the compiler tag)

compilerSourcePath/
sourceAttachmentPath/


Hope this helps someone else along the way.
cheers,
PW

--- In flexcoders@yahoogroups.com, parkerwhirlow [EMAIL PROTECTED]
wrote:

 
 I just installed Flex Builder Plugin 2.0.1 Updater, and followed
 install instructions, running eclipse -clean -vmargs -Xmx512m
 
 Has anyone else seen this error?
 I've searched flexcoders, and this problem appears to be unique.
 thanks,
 PW
 
 When Flex starts up I get this error:
 
 A problem occurred while opening this project. Try quitting and
 restarting the application. If the problem persists, you may be using
 an unsupported project version, or your project files may be corrupted.
 
 
 In the Eclipse error log, I have this:
 
 !SUBENTRY 1 com.adobe.flexbuilder.project 4 43 2007-01-16 09:24:58.617
 !MESSAGE Error Loading Project
 !STACK 0
 com.adobe.flexbuilder.project.persist.PersistenceException: Expected a
 single compilerSourcePath tag but found 0
 at

com.adobe.flexbuilder.project.persist.TagSetting.getSingleElement(Unknown
 Source)
 at com.adobe.flexbuilder.project.persist.ClassPathSetting.read(Unknown
 Source)
 at com.adobe.flexbuilder.project.persist.ContainerTag.read(Unknown
Source)
 ...





[flexcoders] Re: DataGrid - numeric sort?

2007-01-11 Thread parkerwhirlow
DUDE! what the heck ?

You must have copied out the labelFunction... thats not
sortCompareFunction... it definitely requires two objects to compare!

Your example implementation even does a simple number format =)

Nice try though.
PW

In the Language Reference, the only documentation for sortCompareFunction

--- In flexcoders@yahoogroups.com, michael_ramirez44
[EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, parkerwhirlow 
 parkerwhirlow@ wrote:
 
  
  Its amazing how complicated something so seemingly easy can be...
  
  All I want to do is provide a numeric sort for columns that contain
  numeric data. (by default the sorting is all text based)
  
  I found the DataGridColumn.sortCompareFunction and tried this.
  
  The problem I have is that the objects passed to the function are 
 the
  entire row, and I have no context of which column the sort is for.
  
  It seems like they left out some key information in the signatures 
 of
  some of the DataGrid functions... for instance labelFunction 
 signature
  has the column being rendered but dataTipFunction does not. 
 Therefore
  I have the same issue with dataTipFunction as I do with
  sortCompareFunction... how do you know what column you're working 
 with?
  
  Anyone know any tricks? How have others implemented custom sorting 
 of
  datagrids?
  
  thanks,
  PW
 
 
 The signature on the SortCompareFunction:
 
 private function sortNumber(item:Object,column:DataGridColumn):String
 {
   return numFormatter.format(item[column.dataField]);
 }





[flexcoders] DataGrid - numeric sort?

2007-01-10 Thread parkerwhirlow

Its amazing how complicated something so seemingly easy can be...

All I want to do is provide a numeric sort for columns that contain
numeric data. (by default the sorting is all text based)

I found the DataGridColumn.sortCompareFunction and tried this.

The problem I have is that the objects passed to the function are the
entire row, and I have no context of which column the sort is for.

It seems like they left out some key information in the signatures of
some of the DataGrid functions... for instance labelFunction signature
has the column being rendered but dataTipFunction does not. Therefore
I have the same issue with dataTipFunction as I do with
sortCompareFunction... how do you know what column you're working with?

Anyone know any tricks? How have others implemented custom sorting of
datagrids?

thanks,
PW




[flexcoders] Bug fixes list for 2.0.1?

2007-01-09 Thread parkerwhirlow
Hi all,

I was wondering if there exists a list of bugs that were fixed in the
2.0.1 Flex SDK?

I have seen quite a few bugs reported and filed here on flexcoders,
(and I'm sure there were more than that) and I'd like to track down a
couple to see if they were fixed.

Anyone heard of such a list?

thanks,
PW



[flexcoders] Re: working example of custom MenuDataDescriptor?

2007-01-09 Thread parkerwhirlow

Have you found a solution for this?

I'm having similar problem. I have set my custom data descriptor to my
menu before showing it, however the sub-menu that is automatically
created, is having the DefaultDataDescriptor assigned to it. This
causes the sub-menu to fail to show.

I am not sure why your data descriptor methods were not being called,
my menu data provider is an ArrayCollection of objects, and my methods
are being called. You might give that a shot.

PW

--- In flexcoders@yahoogroups.com, Bastian Waidelich [EMAIL PROTECTED] 
wrote:

 Hello group,
 
 Does anybody have a working example of a MenuBar with a custom
 dataDescriptor?
 According to the example Creating a custom data descriptor in the
 Flex documentation I have created a Class which implements
 IMenuDataDescriptor. Now when my dataSource is an Array of objects
 only the method isEnabled of the dataDescriptor will be called..
 When the dataSource is XML-based, the method getChildren is called
 at least - But only once.
 
 What I need is a Menu which only shows e.g. level 1 to 3 of the
 dataSource.
 Some help would be greatly appreciated, this hast cost me some
 sleepless nights already - Flex is a great thing indeed, but sometimes
 it's just killing me ;)





[flexcoders] menu / sub menu with custom dataDescriptor

2007-01-09 Thread parkerwhirlow

I think I've run into a horrible defect with Menu... Maybe I'm missing
something, here.

I have a menu that I assign a custom dataDescriptor. The top menu
shows fine. However, when a sub-menu is shown, it assigns a
DefaultDataDescriptor, not my custom dataDescriptor.

I have tried catching the showMenu event and assigning it, but I get a
null pointer exception (my dataProvider items do not have a 'type'
property) before I get any event for the subMenu.

Anyone heard of this? Any workarounds you can think of?

I thought of trying to sub-class Menu, but the one function I need to
override to fix this is mx_internal function openSubMenu(...)

thanks.
PW



[flexcoders] Re: eclipse, FB, and Peter's FDS plugin

2007-01-04 Thread parkerwhirlow
I was getting these memory errors even after raising the memory (-Xms
and -Xmx) but also had to add the following. 

-XX:MaxPermSize=256m

Once I did this, I haven't gotten them anymore.

PW


--- In flexcoders@yahoogroups.com, Dimitrios Gianninas
[EMAIL PROTECTED] wrote:

 I'm using 3.2.1 and a whole bunch of callisto plugins (which
includes WTP) and eclipse gives me memory warnings at least twice a
day, I have to shutdown and restart... ya darn annoying if u ask me.
  
 Dimitrios Gianninas
 RIA Developer
 Optimal Payments Inc.
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of Douglas Knudsen
 Sent: Wednesday, January 03, 2007 1:26 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] eclipse, FB, and Peter's FDS plugin
 
 
 
 Anyone using eclipse, FB, and Peter's FDS plugin?  I'm using eclipse
wtp-all-in-one-sdk-R-1.0.2-200604200208-win32, FB 2, and Peter's FDS
plugin.  I'm experience MAJOR CPU spikes and memory use form eclipse
in this config.  I've raised the jvm heap and all, as high as 1024m,
yet still get out of memory errors.  Oh, I upgraded to the latest
1.5.0.10 JVM from Sun too.  I'm working on a FDS project with Tomcat
5.5 and this is killing me.   Any ideas?   Something wrong in the WTP
package?  Should I use the sysdeo tomcat plugin instead of the one in
WTP?  No other plugins installed currently and on a fresh eclipse
download too. 
 
 -- 
 Douglas Knudsen
 http://www.cubicleman.com http://www.cubicleman.com 
 this is my signature, like it? 
 
  
 
 -- 
 WARNING
 ---
 This electronic message and its attachments may contain
confidential, proprietary or legally privileged information, which is
solely for the use of the intended recipient.  No privilege or other
rights are waived by any unintended transmission or unauthorized
retransmission of this message.  If you are not the intended recipient
of this message, or if you have received it in error, you should
immediately stop reading this message and delete it and all
attachments from your system.  The reading, distribution, copying or
other use of this message or its attachments by unintended recipients
is unauthorized and may be unlawful.  If you have received this e-mail
in error, please notify the sender.
 
 AVIS IMPORTANT
 --
 Ce message électronique et ses pièces jointes peuvent contenir des
renseignements confidentiels, exclusifs ou légalement privilégiés
destinés au seul usage du destinataire visé.  L'expéditeur original ne
renonce à aucun privilège ou à aucun autre droit si le présent message
a été transmis involontairement ou s'il est retransmis sans son
autorisation.  Si vous n'êtes pas le destinataire visé du présent
message ou si vous l'avez reçu par erreur, veuillez cesser
immédiatement de le lire et le supprimer, ainsi que toutes ses pièces
jointes, de votre système.  La lecture, la distribution, la copie ou
tout autre usage du présent message ou de ses pièces jointes par des
personnes autres que le destinataire visé ne sont pas autorisés et
pourraient être illégaux.  Si vous avez reçu ce courrier électronique
par erreur, veuillez en aviser l'expéditeur.





[flexcoders] Re: Rich text editor in TabNavigator causes runtime exception.

2007-01-03 Thread parkerwhirlow
It is also strongly stated in the docs that the RichTextEditor IS a
container (subclass of Panel)

I have added an outer container wrapper for this and it did work.
Thanks for that tip.

PW

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 Ah, it is strongly implied in the docs that TabNavigator children must
 be containers: ...for navigating between its child containers ..., and
 similar language.
 
 Tracy
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Tuesday, January 02, 2007 5:34 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Rich text editor in TabNavigator causes runtime
 exception.
 
  
 
 Hi all,
 
 I have placed a RichTextEditor into a tabNavigator, and I get the
 following runtime error. See sample app. If you remove the
 tabNavigator, then the RichTextEditor works fine.
 
 Any ideas? Am I doing something dumb?
 
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
 at
 mx.controls::RichTextEditor/mx.controls:RichTextEditor::createChildren()
 at mx.core::UIComponent/initialize()
 at mx.core::Container/initialize()
 
 and
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
 at mx.controls::RichTextEditor/::getTextStyles()
 at Function/http://adobe.com/AS3/2006/builtin::apply
 http://adobe.com/AS3/2006/builtin::apply ()
 at mx.core::UIComponent/::callLaterDispatcher2()
 at mx.core::UIComponent/::callLaterDispatcher()
 
 _
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application 
 xmlns:mx=http://www.adobe.com/2006/mxml
 http://www.adobe.com/2006/mxml  
 layout=vertical 
 width=400 height=300
 mx:TabNavigator width=100% height=100%
 mx:RichTextEditor label=SQL 
 width=100% height=100% 
 showControlBar=false headerHeight=0 
 borderThicknessBottom=10 borderThicknessTop=10
 /mx:RichTextEditor
 /mx:TabNavigator
 /mx:Application





[flexcoders] Chart showDataEffect being canceled?!

2007-01-03 Thread parkerwhirlow

I've spent hours and hours tracking down an intermittent failure of
the showDataEffect to trigger. Sometimes it just didn't work.

After all these hours, I realized the effect is actually being
canceled! In ChartBase, setActualSize is being called, and the effect
is being canceled.

override public function setActualSize(w:Number, h:Number):void
{
   if (w != this.width || h != this.height)
   cancelEffect();

   super.setActualSize(w, h);
}


There are two things I can't figure out... the first one is why it is
necessary to cancel any pending effect if the size is different, but
the more immediate one is why my chart is changing size when all that
changed was the chart data? All I've done is re-query my chart for
different data.

Seems like effects are pretty worthless if they're intermittent. Am I
overlooking something here or is this a limitation that was considered
acceptable?

thanks,
PW




[flexcoders] Rich text editor in TabNavigator causes runtime exception.

2007-01-02 Thread parkerwhirlow
Hi all,

I have placed a RichTextEditor into a tabNavigator, and I get the
following runtime error. See sample app. If you remove the
tabNavigator, then the RichTextEditor works fine.

Any ideas? Am I doing something dumb?


TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at
mx.controls::RichTextEditor/mx.controls:RichTextEditor::createChildren()
at mx.core::UIComponent/initialize()
at mx.core::Container/initialize()

and
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at mx.controls::RichTextEditor/::getTextStyles()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

_


?xml version=1.0 encoding=utf-8?
mx:Application 
xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=vertical 
width=400 height=300
mx:TabNavigator width=100% height=100%
mx:RichTextEditor label=SQL 
width=100% height=100% 
showControlBar=false headerHeight=0 
borderThicknessBottom=10 borderThicknessTop=10
/mx:RichTextEditor
/mx:TabNavigator
/mx:Application



[flexcoders] Re: Percentage based width in ActionScript

2006-12-28 Thread parkerwhirlow
You should be able to assign percentHeight and percentWidth properties
in AS... I do this fairly often.

PW

--- In flexcoders@yahoogroups.com, Matt Maher [EMAIL PROTECTED] wrote:

 Yikes, I am creating a component in ActionScript and adding an HBOX to
 it as a child. I want that hbox to fill 90% of the width of this. 
 
 I see on this page

http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0518.html
 
 a comment about percentHeight, percentWidth In MXML tags only...
 
 Come on, really? This seems a very troubling shortcoming. I just know
 one of you gurus has figured out a simple fix for this, right?





[flexcoders] Re: Bug using FDS to persist managed association as Set

2006-12-26 Thread parkerwhirlow
Hi Jeff,

I tracked it down. The bug is line 662 in this loop (note i vs. k):
int k;
for (k = i; k  toList.size(); k++)
{
  if (assocType.getIdentityFromItem(toList.get(i)).equals(fromId))
break;
}

I'm fixing locally, and also probably going to write a separate
routine for non-ordered sets. I realized with your message and looking
over it again that it re-orders them even if it's a set.

Don't know if this one will make it into 2.0.1, sounds like it may be
too late.

thanks
PW

--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 I don't know of a bug in that code... I can explain what should be
 happening.   There is probably a more efficient (and simpler) way to do
 this when you know you are dealing with an unordered set, but I don't
 know why it is breaking right now.
 
  
 
 When it hits line 675 for an item which is in both sets, it should have
 previously hit the call to remove that very same item a few lines
 earlier 671.  The code is written so that it is merging two sorted lists
 and so it will remove and reinsert an item if it has to shift the
 position.  Because the position of an item in a Set is can be random,
 this may end up doing a lot more work than is necessary. 
 
  
 
 I think that when it hits the end of the list, it should just be culling
 off items that are in the toList which should not be.  If the
 equals/hashCode methods get messed up, this could easily get messed up
 though so that is one thing to check.   If the remove call fails to find
 the item to remove, things would get out of sync between the set and the
 list and I'm not sure what would happen.
 
  
 
 For Sets, we probably should just have one loop which iterates over the
 to list.  If the item is not in the from list we remove it from the
 toList.  Then we loop over the from list and if it is not in the toList
 we add it to the toList.  If the equals and hashCode methods are not
 right for the items in the list and the id properties, this probably
 would not fix the problem though.
 
  
 
 In terms of recompiling the HibernateAssembler, I think you can just
 compile it normally with the WEB-INF/lib classes in your classpath.  You
 can find HibernateAssembler in one of the flex-messaging jar files and
 just replace the old one with the new one.  
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Friday, December 22, 2006 5:06 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Bug using FDS to persist managed association as
 Set
 
  
 
 This is probably best handled by Jeff Vroom, but I'm open to comments
 from anyone
 
 I have dug through the HibernateAssembler source after seeing very
 strange behavior, and I think I've uncovered a bug in the
 HibernateAssembler.
 
 When it is persisting a change to a property that is an FDS managed
 relationship, and that relationship is a collection mapped as a Set in
 Hibernate, it ends up removing a bunch of items from the collection
 that should not be removed...
 
 HibernateAssembler line 591 starts a routine that is supposed to merge
 the new collection with the one from the server.
 
 Because the collection is a PersistentSet, not a List, the variable
 isList is false, and it gets an ArrayList from the collection to have
 sequential access.
 
 while looping through each item in the fromList, even though the item
 is in both collections, at line 675 it calls add on toList and toColl. 
 
 toColl is a set, so the add function replaces the existing object
 (which it should in case the new one has changed). And the item is
 added to the end of the toList.
 
 After looping through each item in fromList, line 686 removes items
 from toColl and toList until they are the same length. I'm not sure
 why it is doing this, but it is removing the items from the toColl,
 and when done, toColl has much less items in it than it should.
 
 Is this a known/fixed defect?
 
 I'm going to start trying to compile this class so that I can
 implement a fix for it, but I'm not positive what is needed to do so.
 If there is a fix for it already, I'd love to get it.
 
 thanks,
 PW





[flexcoders] Re: DataService commit() doesn't finish.

2006-12-26 Thread parkerwhirlow
Hi Jeff,

No, the fault handler isn't called. This is part of what confuses me. 

Will be anxiously awaiting the 2.0.1 release for further
troubleshooting of this.

thanks,
PW


--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 It looks like an exception is occurring and the transaction is being
 rolled back.  Is your fault handler being called on the client side?  I
 think that there are certain types of Errors and RuntimeExceptions which
 are not being logged properly by the FDS MessageService so that is
 making this look mysterious in the logs.  If the error is occurring
 after the updateItem call succeeds, it will be hard to track down
 without libraries that do that logging.   2.0.1 is coming out real soon
 now and has some improvements to the logging so that might be worth a
 try.  
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of parkerwhirlow
 Sent: Thursday, December 21, 2006 4:14 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] DataService commit() doesn't finish.
 
  
 
 
 Hi guys,
 
 I have some functionality that used to work that isn't working
 anymore... using FDMS and HibernateAssembler. 
 
 From Flex, I've made one single change and used DataService.commit(),
 and added a responder to the AsyncToken.
 
 On the server, I can trace through the HibernateAssembler.updateItem()
 and everything goes fine. The commit code doesn't get called though
 because Transactions are true, and the syncSession is used.
 
 There is some server trace of an AcknowledgeMessage getting sent, but
 the responder never gets called, and if I refresh the flex client, the
 values are not saved.
 
 Please see the log trace below, and let me know if I missed anything.
 
 thanks,
 PW
 
 12/21 15:49:55 user [Flex] 15:49:55.658 [DEBUG]
 [Message.Data.transacted] Before invoke service: data-service
 incomingMessage: Flex Message (flex.data.messages.DataMessage)
 operation = transacted
 id = null
 clientId = 37BE2173-400E-D4C7-CBC3-2943A841449A
 correlationId =
 destination = Model
 messageId = F4DE4EEE-9D72-806C-A4DB-A76BC6F02C11
 timestamp = 1166744995648
 timeToLive = 0
 body =
 [
 Flex Message (flex.data.messages.DataMessage)
 operation = update
 id = ASObject(32376284){id=1163778853188464256078}
 clientId = CCD745B5-3C9E-C584-4ED4-A7666B51EEF4
 correlationId = F4DE4EEE-9D72-806C-A4DB-A76BC6F02C11
 destination = Application
 messageId = 8577BADB-417B-D762-5E92-A76B983BAA25
 timestamp = 0
 timeToLive = 0
 body =
 [
 
 [
 selecteddisplay
 ],
 [EMAIL PROTECTED],
 [EMAIL PROTECTED]
 ]
 hdr(newReferencedIds) = {displays=
 [
 {id=1156440527883820192695},
 {id=1164384322718557235986},
 {id=1164388051550092880785},
 {id=1164467025953663641911},
 {id=1164467032523719875336},
 {id=1164467037039304665983}
 ]}
 hdr(prevReferencedIds) = {displays=
 [
 {id=1156440527883820192695},
 {id=1164384322718557235986},
 {id=1164388051550092880785},
 {id=1164467025953663641911},
 {id=1164467032523719875336},
 {id=1164467037039304665983}
 ]}
 ]
 hdr(DSEndpoint) = my-rtmp
 
 12/21 15:49:55 user [Flex] 15:49:55.819 [DEBUG]
 [DataService.Transaction] Started transaction using jndi name:
 java:comp/UserTransaction
 12/21 15:49:55 user [Flex] 15:49:55.949 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1156440527883820192695 -
 [EMAIL PROTECTED]
 12/21 15:50:06 user [Flex] 15:50:06.864 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164384322718557235986 -
 [EMAIL PROTECTED]
 12/21 15:50:11 user [Flex] 15:50:11.261 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164388051550092880785 -
 [EMAIL PROTECTED]
 12/21 15:50:15 user [Flex] 15:50:15.707 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164467025953663641911 -
 [EMAIL PROTECTED]
 12/21 15:50:19 user [Flex] 15:50:19.753 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164467032523719875336 -
 [EMAIL PROTECTED]
 12/21 15:50:23 user [Flex] 15:50:23.789 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164467037039304665983 -
 [EMAIL PROTECTED]
 12/21 15:50:27 user [Flex] 15:50:27.684 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1156440527883820192695 -
 [EMAIL PROTECTED]
 12/21 15:50:27 user [Flex] 15:50:27.784 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164384322718557235986 -
 [EMAIL PROTECTED]
 12/21 15:50:27 user [Flex] 15:50:27.805 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164388051550092880785 -
 [EMAIL PROTECTED]
 12/21 15:50:27 user [Flex] 15:50:27.825 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164467025953663641911 -
 [EMAIL PROTECTED]
 12/21 15:50:27 user [Flex] 15:50:27.845 [DEBUG]
 [DataService.Hibernate] Get object from hibernate with
 id=1164467032523719875336 -
 [EMAIL PROTECTED]
 12/21 15:50:27 user [Flex] 15:50:27.855 [DEBUG]
 [DataService.Hibernate

[flexcoders] Re: enabling Hibernate logging through log4j with jrun/fds2

2006-12-22 Thread parkerwhirlow
I have gotten hibernate logging to work by placing log4j.jar into the
web-inf/lib directory, and placing a log4j.properties (you can use the
sample) into the web-inf/classes directory. That was all I needed to do.

good luck,
PW

--- In flexcoders@yahoogroups.com, thunderstumpgesatwork
[EMAIL PROTECTED] wrote:

 
 Does anyone know how to get hibernate logging when using FDS and the
 HibernateAssembler? From my reading on Hibernate: see

http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging
 , they use log4j, and talk about putting a log4j.properties file in
 the WEB-INF/classes directory, but I have tried this with no luck...
 
 Also, I'm not referring to Flex's Hibernate Assembler log set up by
 setting patternDataService.Hibernate/pattern in the
 services-config.xml log target... I'm talking about getting internal
 Hibernate log output.
 
 thanks,
 Thunder





[flexcoders] Bug using FDS to persist managed association as Set

2006-12-22 Thread parkerwhirlow
This is probably best handled by Jeff Vroom, but I'm open to comments
from anyone

I have dug through the HibernateAssembler source after seeing very
strange behavior, and I think I've uncovered a bug in the
HibernateAssembler.

When it is persisting a change to a property that is an FDS managed
relationship, and that relationship is a collection mapped as a Set in
Hibernate, it ends up removing a bunch of items from the collection
that should not be removed...

HibernateAssembler line 591 starts a routine that is supposed to merge
the new collection with the one from the server.

Because the collection is a PersistentSet, not a List, the variable
isList is false, and it gets an ArrayList from the collection to have
sequential access.

while looping through each item in the fromList, even though the item
is in both collections, at line 675 it calls add on toList and toColl. 

toColl is a set, so the add function replaces the existing object
(which it should in case the new one has changed). And the item is
added to the end of the toList.

After looping through each item in fromList, line 686 removes items
from toColl and toList until they are the same length. I'm not sure
why it is doing this, but it is removing the items from the toColl,
and when done, toColl has much less items in it than it should.

Is this a known/fixed defect?

I'm going to start trying to compile this class so that I can
implement a fix for it, but I'm not positive what is needed to do so.
If there is a fix for it already, I'd love to get it.

thanks,
PW




[flexcoders] FDMS destinations and inheritance

2006-12-21 Thread parkerwhirlow
Guys,

I'm trying to properly set up a relationship between a class
View, which has a FDMS destination called View, and
in Hibernate has a relationship called parent which points to a
ViewContainer.

The trick is that ViewContainer is a sub-class of
View. So normally I would create my managed relationship like
this:

destination id=View
...
many-to-one property=parent destination=ViewContainer
lazy=true /
...
/destination

and

destination id=ViewContainer 
...
one-to-many property=childViews
destination=Views lazy=false /
...
/destination


NOW isn't this going to wreak havoc on FDS if the same object (a
ViewContainer) actually matches more than one destination?

specifically when my Application class has a managed relationship to
View, and those views could be
ViewContainers...

How should this be solved properly?

thanks,
PW




[flexcoders] Re: dataGrid Help, populating - newbie array question (consider it a an xmas gift)

2006-12-21 Thread parkerwhirlow
First I think you're confused about the semantics of 
ArrayCollection... it is not a collection of arrays, but rather a 
Collection interface wrapper on a single array.

When you define the dataProvider statically in mxml the way you did, 
what you're doing is creating a single array of Objects (each object 
having 3 properties)

So you want to do the same thing with the ArrayCollection in code...

var dp:ArrayCollection = new ArrayCollection();

var o:Object = new Object();
o.Poll=Do You Like Law And Order;
o.Number=53;
o.owner=batanga/jumpman
o.type=1;

dp.addItem(o);

dgFeatured1.dataProvider = dp;


GoodLuck!
PW

--- In flexcoders@yahoogroups.com, {reduxdj} [EMAIL PROTECTED] wrote:

 Good morning,
 
 Sorry, to post this again, but I'm goin in circles and confused 
how to 
 populate a datagrid properly with an array collection as a 
 dataProvider.  I'm able to use an mx:ArrayCollection or a single 
array 
 in an array collection, but how do I populate it automatically 
with an 
 array collection holding 3 arrays, like this?
 
 mx:DataGrid id=dgFeatured1 width=250 height=150 
 styleName=mainText top=208 left=46 itemClick=itemClickEvent
(event);

 mx:ArrayCollection
 mx:source
   mx:Object Poll=Do You Like Law And Order 
 Number=53 owner=batanga/jumpman type=1/
   mx:Object Poll=When Do You Do Most Of Your 
 Christmas... Number=49 owner=batanga/jumpman type=1/
   mx:Object Poll=Can I Date Your Daughter 
Number=54 
 owner=batanga/DonaldRumsfeld type=1/
  
 /mx:source
  /mx:ArrayCollection
 mx:columns
 
 This works, but I want to do the same thing as above with my 
arrays in 
 an array collection, this probably something really basic I don't 
grasp 
 how to use.  This works, but only with one array in my array 
collection...
 
 var _data_fastest:Object = RemotingProvider.getInstance().getPolls
();
 fastestAC = new ArrayCollection(_data_fastest.fastest);
 
 
 I want to the following, why does this not work the same way, what 
am I 
 not grasping:
 
 fastestAC = new ArrayCollection
(_data_fastest.fastest,_data_.id,_data.type);
 
 then I want to use the dataProvider so I can populate it just like 
the 
 first example and then get my selected item.
 
 Thanks flex genius!





[flexcoders] Re: Datagrid scrolling woes!

2006-12-21 Thread parkerwhirlow
I don't know if you're just trying to be misleading, or mis-typed 
something, but it doesn't help any if you're passing wrong 
information.

DataGrid (or List for that matter) doesn't have a vPosition property 
at all. 

I don't know the answer for sure, but there's a 'scrollPosition' 
property on dataGrid.verticalScrollBar ... thats the one I'd look at 
first.

good luck.
PW

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] 
wrote:

 For DataGrid, setting vPosition=myrowIndex will scroll the grid to 
the
 desired line.
 
  
 
 Tracy
 
  
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Cameron Ray
 Sent: Wednesday, December 20, 2006 6:29 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Datagrid scrolling woes!
 
  
 
 Hello all, I'm trying to accomplish something that is seemingly
 easybut is driving me bananas due to the fact that it's not 
working.
 I want to setup a function that can be called and that function 
will
 scroll my datagrid to a specific row within that datagrid.
 
  
 
 Here's what I've got (that doesn't work)any thoughts?
 
 _
 
  
 
 public function scrollDG():void {
 
  
 
  
 dgUserRequest.editedItemPosition = {columnIndex:0,
 rowIndex:dgUserRequest.dataProvider.length-1};
 
  
 
 }
 
 
  
 
 ]]
 
 /mx:Script
 
  
 
  
 
 mx:Button label=Scroll click=scrollDG()/
 
 mx:Text text={app.userInfo.firstname}'s Videos/
 
 
 
 mx:DataGrid id=dgUserRequest 
x=22
 y=128 dataProvider={app.vidInfo2}
 
 width=850 
height=700
 headerStyleName=headerStyle
 
 mx:columns
 
 
 
  
 mx:DataGridColumn headerText=Thumbnail dataField=thumb_name
 
  
 itemRenderer=components.dgRenderImage width=104/
 
  
 mx:DataGridColumn headerText=Video Title dataField=projectname
 id=title 
 
  
 fontWeight=bold paddingLeft=10/
 
  
 mx:itemRenderer
 
  
 mx:Component
 
  
 mx:VBox verticalAlign=middle
 
  
 mx:Text text={data.projectname}/
 
  
 /mx:VBox
 
  
 /mx:Component
 
  
 /mx:itemRenderer
 
  
 /mx:DataGridColumn
 
  
 mx:DataGridColumn headerText= dataField=projectid
 
  
 itemRenderer=components.dgEditProject width=120/
 
  
 mx:DataGridColumn headerText=Last Modified 
dataField=lastmodified
 
  
 itemRenderer=components.dgLastMod width=150/
 
  
 mx:DataGridColumn headerText= dataField=projectid
 
  
 itemRenderer=components.dgDeleteProject width=75/
 
  
 
 /mx:columns
 
 /mx:DataGrid
 
 

 
  
 
 Thanks for the help.
 
 -Cameron





[flexcoders] Re: RegExp

2006-12-21 Thread parkerwhirlow
a couple quick things.. I'm by no means an expert at regex... but...

the first backslash is unnecessary isn't it?  is not a meta
character, so the \ after the first / isn't needed. also, don't you
want to remove ALL characters between the  and  ? so I'd change the
inner [a-zA-Z0-9]* to   .*?  (the question mark makes it a lazy
quantifier instead of an agressive quantifier)

And one last thing, is you may need the multi-line flag also (if the
XML has line breaks... so I'd give this a shot... haven't tried it
myself though

 /lt;.*?gt;/gim

good luck
PW

--- In flexcoders@yahoogroups.com, e_baggg [EMAIL PROTECTED] wrote:

 I am trying to create a regular expression that essentially parses out
 all the html of a text string. (i.e. - Remove all text between lt;
 and gt;). I am not the seasoned regex pro, but my attempts have
 failed based on research within the livedocs:
 
 var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi
 
 Does anyone see what is wrong?
 
 var stringToEdit : String = lt;!DOCTYPE html PUBLIC '-//W3C//DTD
 HTML 4.01 Transitional//EN'gt;lt;htmlgt;lt;headgt;text I should
 seelt;/headgt;lt;/htmlgt;;
 
 var pattern : RegExp = /\lt;[a-zA-Z0-9]*gt;/gi
 var newStr : String = stringToEdit.replace(pattern, );
 trace(newStr);
 
 //Desired Output:
 text I should see
 
 //Actual output :-( 
 !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01
 Transitional//ENhtmlheadtext I should see/head/html





[flexcoders] DataService commit() doesn't finish.

2006-12-21 Thread parkerwhirlow

Hi guys,

I have some functionality that used to work that isn't working
anymore... using FDMS and HibernateAssembler. 

From Flex, I've made one single change and used DataService.commit(),
and added a responder to the AsyncToken.

On the server, I can trace through the HibernateAssembler.updateItem()
and everything goes fine. The commit code doesn't get called though
because Transactions are true, and the syncSession is used.

There is some server trace of an AcknowledgeMessage getting sent, but
the responder never gets called, and if I refresh the flex client, the
values are not saved.

Please see the log trace below, and let me know if I missed anything.

thanks,
PW


12/21 15:49:55 user [Flex] 15:49:55.658 [DEBUG]
[Message.Data.transacted] Before invoke service: data-service
  incomingMessage: Flex Message (flex.data.messages.DataMessage)
operation = transacted
id = null
clientId = 37BE2173-400E-D4C7-CBC3-2943A841449A
correlationId =
destination = Model
messageId = F4DE4EEE-9D72-806C-A4DB-A76BC6F02C11
timestamp = 1166744995648
timeToLive = 0
body =
[
  Flex Message (flex.data.messages.DataMessage)
  operation = update
  id = ASObject(32376284){id=1163778853188464256078}
  clientId = CCD745B5-3C9E-C584-4ED4-A7666B51EEF4
  correlationId = F4DE4EEE-9D72-806C-A4DB-A76BC6F02C11
  destination = Application
  messageId = 8577BADB-417B-D762-5E92-A76B983BAA25
  timestamp = 0
  timeToLive = 0
  body =
  [

[
  selecteddisplay
],
[EMAIL PROTECTED],
[EMAIL PROTECTED]
  ]
  hdr(newReferencedIds) = {displays=
[
  {id=1156440527883820192695},
  {id=1164384322718557235986},
  {id=1164388051550092880785},
  {id=1164467025953663641911},
  {id=1164467032523719875336},
  {id=1164467037039304665983}
]}
  hdr(prevReferencedIds) = {displays=
[
  {id=1156440527883820192695},
  {id=1164384322718557235986},
  {id=1164388051550092880785},
  {id=1164467025953663641911},
  {id=1164467032523719875336},
  {id=1164467037039304665983}
]}
]
hdr(DSEndpoint) = my-rtmp

12/21 15:49:55 user [Flex] 15:49:55.819 [DEBUG]
[DataService.Transaction] Started transaction using jndi name:
java:comp/UserTransaction
12/21 15:49:55 user [Flex] 15:49:55.949 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1156440527883820192695 -
[EMAIL PROTECTED]
12/21 15:50:06 user [Flex] 15:50:06.864 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164384322718557235986 -
[EMAIL PROTECTED]
12/21 15:50:11 user [Flex] 15:50:11.261 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164388051550092880785 -
[EMAIL PROTECTED]
12/21 15:50:15 user [Flex] 15:50:15.707 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164467025953663641911 -
[EMAIL PROTECTED]
12/21 15:50:19 user [Flex] 15:50:19.753 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164467032523719875336 -
[EMAIL PROTECTED]
12/21 15:50:23 user [Flex] 15:50:23.789 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164467037039304665983 -
[EMAIL PROTECTED]
12/21 15:50:27 user [Flex] 15:50:27.684 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1156440527883820192695 -
[EMAIL PROTECTED]
12/21 15:50:27 user [Flex] 15:50:27.784 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164384322718557235986 -
[EMAIL PROTECTED]
12/21 15:50:27 user [Flex] 15:50:27.805 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164388051550092880785 -
[EMAIL PROTECTED]
12/21 15:50:27 user [Flex] 15:50:27.825 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164467025953663641911 -
[EMAIL PROTECTED]
12/21 15:50:27 user [Flex] 15:50:27.845 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164467032523719875336 -
[EMAIL PROTECTED]
12/21 15:50:27 user [Flex] 15:50:27.855 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1164467037039304665983 -
[EMAIL PROTECTED]
12/21 15:50:43 user [Flex] 15:50:43.577 [DEBUG]
[DataService.Hibernate] Get object from hibernate with
id=1163778853188464256078 - [EMAIL PROTECTED]
8634a
12/21 15:52:31 debug Pool skimmer cleaning objects from the pool that
have exceeded their allotted lifespan, has 1 pooled objects to evaluate
12/21 15:56:28 debug MM GC collected 0 messages, 0 remaining.
12/21 15:56:28 debug DMGC collected 0 caches, 0 remaining.
12/21 15:56:28 debug DMGC collected 0 destinations, 4 remaining.
12/21 15:58:27 user [Flex] 15:58:27.604 [DEBUG]
[Message.Data.transacted] After invoke service: data-service
  reply: Flex Message 

[flexcoders] Re: FDS: Using Hibernate second-level cache possible?

2006-12-21 Thread parkerwhirlow
Jeff, Niko

I don't know exactly your problem, but I DO know where two session
factories could come from =)

I was stepping through all the HibernateManager code just today and
see the following in the HibernateManager.createSessionFactory... (it
creates one session factory for general purpose stuff, then another
for sync or updates/inserts

Hope this might help.
PW
_

sessionFactory = hibernateConfig.buildSessionFactory();

if (useTransactions)
{
// If the DataService is managing transactions, then we need to
change the context of the Hibernate
   // session such that the DataService's management of the
transaction  will handle commiting and closing
   // the session -- this is only needed on sync methods, not on get,
fill or count methods
   
hibernateConfig.setProperty(hibernate.current_session_context_class,
flex.data.adapters.FlexHibernateSessionContext);
   
//hibernateConfig.setProperty(hibernate.transaction.factory_class,
org.hibernate.transaction.JTATransactionFactory);
//hibernateConfig.setProperty(jta.UserTransaction,
TransactionUtility.USER_TX_JNDI_NAME);
syncSessionFactory =
hibernateConfig.buildSessionFactory();
}


--- In flexcoders@yahoogroups.com, Jeff Vroom [EMAIL PROTECTED] wrote:

 I think the important part of the error is here:
 
  
 
 ... 41 more
 Caused by: net.sf.ehcache.CacheException: Cannot parseConfiguration
 CacheManager. Attempt to create a new instance of CacheManager using the
 diskStorePath /tmp/cache which is already used by an existing
 CacheManager. The source of the configuration was classpath.
 at net.sf.ehcache.CacheManager.configure(CacheManager.java:248) at
 net.sf.ehcache.CacheManager.init(CacheManager.java:193) at
 net.sf.ehcache.CacheManager.init(CacheManager.java:180) at
 org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)
 
  
 
 It seems like there are two session factories being started up which are
 configured to use the same cache.  This could be because you have two
 web apps on the same machine each using hibernate.  I don't think that
 flex would be trying to create two SessionFactories unless you were
 using more than one hibernate configuration file.  Flex should share one
 session factory from all destinations which use the same hibernate
 configuration file.   There must be some way to set the path name of the
 cache... maybe you just need to specify a different path name for this
 cache for the FDMS version of hibernate?
 
  
 
 Jeff
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Niko Schmuck
 Sent: Wednesday, December 06, 2006 8:18 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] FDS: Using Hibernate second-level cache possible?
 
  
 
 Hi together,
 
 As a newbie I would like to get your advices on how to use the Hibernate
 caching for Flex Data Management Services. Is this possible at all or a
 contra-diction to the HibernateAssembler?
 
 For my java applications I currently use second-level caching to speed
 up
 data access with Hibernate (3.2), which I would also like to use for my
 Flex app:
 
 For this I use in the Hibernate mapping definition (inside the class
 element):
 
 cache usage=read-write/
 
 Unfortunately if I turn EhCache on (via the hibernate configuration) ...
 
 property
 name=cache.provider_classorg.hibernate.cache.EhCacheProvider/propert
 y
 
 ... the tomcat logs show an ugly stack-trace:
 
 CacheException: Attempt to restart an already started EhCacheProvider.
 
 See below for the exception in its full-length beauty. The only way to
 overcome this, to avoid caching at all by setting:
 
 property
 name=cache.provider_classorg.hibernate.cache.NoCacheProvider/propert
 y
 
 (Also using the recommended SingletonEhCacheProvider does not help)
 
 Any help much appreciated.
 
 Thanks,
 Niko
 
 2006-12-05 08:57:08,737 [main] ERROR
 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/useradmi
 n]
 - Servlet /useradmin threw load() exception
 java.lang.ExceptionInInitializerError
 at
 flex.data.assemblers.HibernateManager.createSessionFactory(HibernateMana
 ger.java:66)
 at
 flex.data.assemblers.HibernateManager.init(HibernateManager.java:44)
 at
 flex.data.assemblers.HibernateAssembler.initialize(HibernateAssembler.ja
 va:137)
 at
 flex.messaging.factories.JavaFactory$JavaFactoryInstance.createInstance(
 JavaFactory.java:254)
 at
 flex.messaging.factories.JavaFactory.createFactoryInstance(JavaFactory.j
 ava:93)
 at
 flex.messaging.FactoryDestination.getFactoryInstance(FactoryDestination.
 java:76)
 at flex.data.adapters.JavaAdapter.server(JavaAdapter.java:158) at
 flex.data.adapters.JavaAdapter.setSettings(JavaAdapter.java:119)
 at flex.messaging.Destination.createAdapter(Destination.java:279)
 at
 flex.messaging.Destination.initDestination(Destination.java:103)
 at