Is it possible using the JTA

Hi I am new to JTA and have a question.. Is JTA used only for handling transactions in Database and can it be used for other purposes like rolling back a method or revert a state of an object in the program.
I have a situation where i have to ftp some files then update the database and then move that ftped file from one folder to another. Can i use JTA for this purpose so that failure of one of the methods infact rolls back the entire process and not make any changes in the files and database.
I do understand that i need to write down code to bring back the files from the Remote Server if they have been sent and the program fails in moving the file to target directory.
Any and all suggestions and comments are welcome.
Thanks

Hi,
In JTA you can only rollback work that implements the XAResource interface. If you implement this interface then you can enlist it in a transaction. The XAResource.rollback method should undo your file move, and will be called together with the database's XAResource.rollback by the transaction manager upon Transaction.rollback.
Best,
Guy

Similar Messages

  • I just want know if is possible use the iphone's charge battery for the i-pod touch. Thank you!

    i just want know if is possible use the iphone's charge battery for the i-pod touch. Thank you!

    Using an  iPhone wall charger for the iPod is fine.  You can also use an iPhone cable for the iPod.
    The term " iphone's charge battery" is not really clear.

  • HT201365 What do I do if my wifi only iPad mini is offline? Is there any way that I can locate it while being offline or turn it online remotely or possibly use the built in GPS?.

    What do I do if my wifi only iPad mini is offline? Is there any way that I can locate it while being offline or turn it online remotely or possibly use the built in GPS?.

    Answer would be no unless application provided such feature. Numbers does not as far as I know.
    Note that even if you have complete list of formulae used in a table, identifying formulae referencing any given cell is not simple.
    E.g., cell T20 is referenced not only in
    =T20+1
    but also in
    =SUM(T)
    =SUM(20:20)
    =SUM(S19:U22)
    =OFFSET(S1,19,1,1,1)
    =INDIRECT("T"&(10*2))
    In order to identify such formula, we have to actually evaluate it to see if it references the given cell. Especially such formula as OFFSET() and INDIRECT() may not be found by static parser because their parameters can be dynamic.
    Sorry to be the bearer of bad tidings.
    H

  • How To use the going back function in Safari (multitouch)? Going back on Websites ist only possible using the arrow Key on the left corner but not by using the sweep function like it is possible in macOS.

    How can i use the going back function in Safari like it is possible in MacOS? On the Mac i can chance back to previous Websites by sweeping with two Fingers. Unfortuntely is this Not possible on the ipad. I tried with one and to fingers but it doesn't work.
    The multitouch function is switched on but still Not working. What is wrong? Thx for help.

    To go back a web page in Safari touch the screen with one finger at the extreme left and swipe to the right.
    To go forward a web page in Safari touch the screen with one finger at the extreme right and swipe to the left.

  • Is it possible to change the UNAME using the FM 'HR_INFOTYPE_OPERATION'..??

    Hi folks,
    I'm trying to bring an infotype record from a SAP Server 'A' to a SAP Server 'B'. The users want an 'Z' application to do it.
    I thought to use the HR_INFOTYPE_OPERATION to INS (insert) or MOD (modify) the record, getting the data from A and put it on B.
    The problem is that the users want to continue keeping the UNAME and AEDTM as in the original record. It means, do not change the record. For Example:
    CURRENT SCENARIO
    SERVER A                       
    UNAME: USER_A        
    AEDTM: July 03, 2010
    SERVER B: Data inserted or modified using the FM 'HR_INFOTYPE_OPERATION'
    UNAME: USER_B
    AEDTM: Jan 24, 2012
    WANTED SCENARIO
    SERVER A                       
    UNAME: USER_A        
    AEDTM: July 03, 2010
    SERVER B: Data inserted or modified using the FM 'HR_INFOTYPE_OPERATION'
    UNAME: USER_A
    AEDTM: July 03, 2010
    Does anybody know if it is possible using the FM 'HR_INFOTYPE_OPERATION'...?
    or
    Does anybody know what's the best way to do that?
    Thanks and best regards friends...

    The issue is fixed after changing the cable connected with e1000g3.

  • How to use the same apple id on two different iphones with different sync?

    Hi all,
    I own an iPhone 4s for personal use. Soon my company is going to give me a business phone and I can choose to have another iPhone. I'd love it but I don't know if what I wanna do is possible.
    Let's say I will have iPhone P (personal) and iPhone B (business) and Apple ID MyID.
    At the moment on iPhone P with account MyID I have application App1, App2, ... App9, I have contacts Cont1, Cont2, ...Cont9, I have songs Song1, Song2, ... Song9. All these are synced on my personal PC via iTunes and stored in the iCloud.
    When I'll get iPhone B I'd love to be able to use on it my Apple ID MyID and to sync it with my business PC (so NOT the same one I use for iPhone P).
    The configuration I'd love to have would be the following.
    iPhone P
    - Applications: App1, App2, App3, App8, App9
    - Contacts: Cont1, Cont2, ... Cont9
    - Songs: Song1, Song2, ... Song9
    iPhone B
    - Applications: App4, App5,App6, App7, App8, App9, App10 etc.
    - Contacts: Cont1, Cont2, Cont10, Cont11, ..., Cont20
    - Songs: Song1, Song2, Song10, Song11, ... Song20
    So will it be possible using the same Apple ID MyID on both iPhones to have this configuration? Some apps, contacts and songs in common and some differents?
    If so, how should I configure the two iPhones and the two PCs?
    Kind regards.

    If you use the same Apple ID for iCloud on each device, yes. However, you can use the same Apple ID for iTunes content on each device, but different Apple ID's for iCloud, iMessage, FaceTime, etc., on each device. That way, you can have whatever iTunes content you want on each phone, but keep all of the other data separate. You can create another Apple ID here:
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/wa/createAppleId?loca lang=en_US
    Must be a verified email address.

  • How to count number of lines inside methods() using the Doclet API

    Wrote a custom doclet using the [Doclet API|http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/doclet/index.html ] .
    The purpose for the doclet is to load Java source files and create stubs (which are identical Java source files but do not contain any method implementation details).
    Instead, the method implementation details need to be replaced with blank lines...
    public class MyDoclet {
         private static String TAB = "\t";
         public static boolean start(RootDoc root) {
              ClassDoc[] classes = root.classes();
              // Parse through class or interface
              for (ClassDoc clazz : classes) {
                   Type superClass = clazz.superclassType();     
                   // Print Methods
                   MethodDoc[] methods = clazz.methods();
                   for (MethodDoc method : methods) {
                        Parameter[] parameters = method.parameters();
                        println();
                        if (!method.isPrivate()) {
                             print(TAB + method.modifiers() + " "
                                                    + method.returnType().simpleTypeName() + " " + method.name());
                             print("(");
                             for (int i=0; i < parameters.length; i++) {
                                  Parameter parameter = (Parameter) parameters;
                                  print(parameter.type().simpleTypeName() + " " + parameter.name());
                                  if (i != parameters.length - 1) {
                                       print(", ");
                             print(")");
                             println(" {");
                             println("\n");
                             println(TAB + "}");
              return true;
    As one can see, I am just creating the method and placing the opening and closing curly braces (along with a new \n line escape sequence, in between).
    Am not really that familiar with the Doclet API...
    Question(s):
    (1) What is the best way to figure out how many lines of code are inside each method and then use a for loop to insert the exact same number of blank lines inside the methods?
    (2) Is there a way to do it using the com.sun.javadoc.SourcePosition.line() method?
    Would really appreciate it if someone could help me because this is an important requirement (hence the 10 Duke Stars).
    Happy coding to all,
    Mike                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    This is not possible using the Doclet API, because JavaDoc does not store any information regarding implementation detail. Although MethodDoc#position will give you the line where the method is declared, there is no way to determine where the method body starts and ends.
    If you need that much information, maybe you would be better of using a tool such as Eclipse's Abstract Syntax Tree parser. AST will provide you with line numbers for each code expression, hence it is relatively easy to compute the first and last line in a method body.

  • Can I use the redemption code for more than one machine for Photoshop Elements?

    I want to use the Photoshop Elements that I bought on more than one machine. Is that
    possible using the Redemption Code? It says it was used with another Adobe ID.
    Thanks

    Hi Stover,
    Typically you use the redemption code to retrieve your serial number for Elements products. The licensing for Elements allows the owner to install on two of their computers.
    See these for reference:
    Redemption Code Help
    How many computers can I install Photoshop Elements on?
    Hope that helps,
    - Dave

  • In iOS, is there a way to insert both a high tone mark and a nasal tone mark on the same letter using the English (U.S. Extended) keyboard?

    For example: į́ and ę́. The notation required for the Navajo language is possible using the desktop implementation of the keyboard, but I am not sure if it can be done with the iOS implementation.

    by_ron wrote:
    It seems the Vietnamese layout does not display the correct character notation
    Yes, that post by me was totally erroneous, it was intended for a different discussion.  Sorry for the confusion.

  • Do you have to implement SRM to use the self service procurement?

    I was interested in possibly using the self service procurement functionality. Do you have to implement SRM for this to be available? Thanks!
    Chris Lintner
    Aflac

    Hi Aflac
    look into solution map of SRM. SSP is one of the Business scenario in SRM part.
    http://www.sap.com/solutions/businessmaps/E670DA60A2184FD99EC12CAB4C9D5150/index.epx
    http://solutioncomposer.sap.com/socoview(bD1lbiZjPTAwMSZkPW1pbg==)/render.asp?sap-unique=054220&sap-params=aWQ9NDk1RTc1RTZGOTg3NEM3M0EyRTA0OTY3MDA4RjM3NTYmcGFja2FnZWlkPURFMDQyOTg0REIzNzI1RjE5NTE1MDAxQTY0RDNGNDYy
    br
    muthu

  • Strange memory behaviour using the System.Collections.Hashtable in object reference

    Dear all,
    Recently I came across a strange memory behaviour when comparing the system.collections.hashtable versus de scripting.dictionary object and thought to analyse it a bit in depth. First I thought I incorrectly destroyed references to the class and
    child classes but even when properly destroying them (and even implemented a "SafeObject" with deallocate method) I kept seeing strange memory behaviour.
    Hope this will help others when facing strange memory usage BUT I dont have a solution to the problem (yet) suggestions are welcome.
    Setting:
    I have a parent class that stores data in child classes through the use of a dictionary object. I want to store many differenct items in memory and fetching or alteging them must be as efficient as possible using the dictionary ability of retrieving key
    / value pairs. When the child class (which I store in the dictionary as value) contains another dictionary object memory handeling is as expected where all used memory is release upon the objects leaving scope (or destroyed via code). When I use a system.collection.hashtable
    no memory is released at all though apears to have some internal flag that marks it as useable for another system.collection.hashtable object.
    I created a small test snippet of code to test this behaviour with (running excel from the Office Plus 2010 version) The snippet contains a module to instantiate the parent class and child classes that will contain the data. One sub will test the Hash functionality
    and the other sub will test the dictionary functionality.
    Module1
    Option Explicit
    Sub testHash()
    Dim Parent As parent_class
    Dim d_Count As Double
    'Instantiate parent class
    Set Parent = New parent_class
    'Create a child using the hash collection object
    Parent.AddChildHash "TEST_hash"
    Dim d_CycleCount As Double
    d_CycleCount = 50000
    'Add dummy data records to the child container with x amount of data For d_Count = 0 To d_CycleCount
    Parent.ChildContainer("TEST_hash").InsertDataToHash CStr(d_Count), "dummy data"
    Next
    'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
    'According to documentation and debug messages not really required!
    Set Parent.ChildContainer("TEST_hash") = Nothing
    'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
    Set Parent = Nothing
    End Sub
    Sub testDict()
    Dim Parent As parent_class
    Dim d_Count As Double
    'Instantiate parent class
    Set Parent = New parent_class
    'Create a child using the dictionary object
    Parent.AddChildDict "TEST_dict"
    Dim d_CycleCount As Double
    d_CycleCount = 50000
    'Blow up the memory with x amount of records
    Dim s_SheetCycleCount As String
    s_SheetCycleCount = ThisWorkbook.Worksheets("ButtonSheet").Range("K2").Value
    If IsNumeric(s_SheetCycleCount) Then d_CycleCount = CDbl(s_SheetCycleCount)
    'Add dummy data records to the child container
    For d_Count = 0 To d_CycleCount
    Parent.ChildContainer("TEST_dict").InsertDataToDict CStr(d_Count), "dummy data"
    Next
    'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
    'According to documentation and debug messages not really required!
    Set Parent.ChildContainer("TEST_dict") = Nothing
    'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
    Set Parent = Nothing
    End Sub
    parent_class:
    Option Explicit
    Public ChildContainer As Object
    Private Counter As Double
    Private Sub Class_Initialize()
    Debug.Print "Parent initialized"
    Set ChildContainer = CreateObject("Scripting.dictionary")
    End Sub
    Public Sub AddChildHash(ByRef ChildKey As String)
    If Not ChildContainer.Exists(ChildKey) Then
    Dim TmpChild As child_class_hashtable
    Set TmpChild = New child_class_hashtable
    ChildContainer.Add ChildKey, TmpChild
    Counter = Counter + 1
    Set TmpChild = Nothing
    End If
    End Sub
    Public Sub AddChildDict(ByRef ChildKey As String)
    If Not ChildContainer.Exists(ChildKey) Then
    Dim TmpChild As child_class_dict
    Set TmpChild = New child_class_dict
    ChildContainer.Add ChildKey, TmpChild
    Counter = Counter + 1
    Set TmpChild = Nothing
    End If
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Parent being killed, first kill all childs (if there are any left!) - muahaha"
    Set ChildContainer = Nothing
    Debug.Print "Parent killed"
    End Sub
    child_class_dict
    Option Explicit
    Public MemmoryLeakObject As Object
    Private Sub Class_Initialize()
    Debug.Print "Child using Scripting.Dictionary initialized"
    Set MemmoryLeakObject = CreateObject("Scripting.Dictionary")
    End Sub
    Public Sub InsertDataToDict(ByRef KeyValue As String, ByRef DataValue As String)
    If Not MemmoryLeakObject.Exists(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Child using Scripting.Dictionary terminated"
    Set MemmoryLeakObject = Nothing
    End Sub
    child_class_hash:
    Option Explicit
    Public MemmoryLeakObject As Object
    Private Sub Class_Initialize()
    Debug.Print "Child using System.Collections.Hashtable initialized"
    Set MemmoryLeakObject = CreateObject("System.Collections.Hashtable")
    End Sub
    Public Sub InsertDataToHash(ByRef KeyValue As String, ByRef DataValue As String)
    If Not MemmoryLeakObject.ContainsKey(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
    End Sub
    Private Sub Class_Terminate()
    Debug.Print "Child using System.Collections.Hashtable terminated"
    Set MemmoryLeakObject = Nothing
    End Sub
    Statistics:
    TEST: (Chronologically ordered)
    1.1 Excel starting memory: 25.324 kb approximately
    Max memory usage after hash (500.000 records) 84.352 kb approximately
    Memory released: 0 %
    1.2 max memory usages after 2nd consequtive hash usage 81.616 kb approximately
    "observation:
    - memory is released then reused
    - less max memory consumed"
    1.3 max memory usages after 3rd consequtive hash usage 80.000 kb approximately
    "observation:
    - memory is released then reused
    - less max memory consumed"
    1.4 Running the dictionary procedure after any of the hash runs will start from the already allocated memory
    In this case from 80000 kb to 147000 kb
    Close excel, free up memory and restart excel
    2.1 Excel starting memory: 25.324 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released: 91,9%
    2.2 Excel starting memory 2nd consequtive dict run: 27.552 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released: 99,4%
    2.3 Excel starting memory 3rd consequtive dict run: 27.712 kb approximately
    Max memory usage after dict (500.000 records) 90.000 kb approximately
    Memory released:

    Hi Cor,
    Thank you for going through my post and took the time to reply :) Most apreciated. The issue I am facing is that the memory is not reallocated when using mixed object types and is not behaving the same. I not understand that .net versus the older methods
    use memory allocation differently and perhaps using the .net dictionary object (in stead of the scripting.dictionary) may lead to similar behaviour. {Curious to find that out -> put to the to do list of interesting thingies to explore}
    I agree that allocated memory is not a bad thing as the blocks are already assigned to the program and therefore should be reallocated with more performance. However the dictionary object versus hashtable perform almost identical (and sometimes even favor
    the dictionary object)
    The hashtable is clearly the winner when dealing with small sets of data.
    The issue arises when I am using the hash table in conjunction with another type, for example a dictionary, I see that the dictionary object's memory is stacked on top of the claimed memory space of the hashtable. It appears that .net memory allocation and
    reuse is for .net references only. :) (Or so it seems)
    In another example I got with the similar setup, I see that the total used memory is never released or reclaimed and leakage of around 20% allocated memory remains to eventually crash the system with the out of memory message. (This is when another class
    calls the parent class that instantiates the child class but thats not the point of the question at hand)
    This leakage drove me to investigate and create the example of this post in the first place. For the solution with the class -> parent class -> child class memory leak I switched all to dictionaries and no leakage occurs anymore but nevertheless thought
    it may be good to share / ask if anyone else knows more :D (Never to old to learn something new)

  • How can I use the property 'top left visible cell' in a table?

    Hi! I use a table in my program and I want to show the top left cell of the table every time when the user clicks a button .I don't know how to do this. If I use a multicolumnListbox I can select the property 'top left visivle cell'. Is it possible with a table ?
    Thanks for any help.

    Yes, it's possible - use the "index value" property to set top-left cell for arrays and tables. See example attached.
    Attachments:
    Index_value_ex.vi ‏30 KB

  • "select into" query statements using the DI API

    I am trying to use the DI API (6.5) t create a temp table based on an existing table.  For example, here is a query string....
    select * into ORDR_TEMP from ORDR
    Code...
    oRecordSet := IRecordset(oCompany.GetBusinessObject(BoRecordset));
    oRecordset.DoQuery(sSql);
    Error I get...
    1). [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use SELECT INTO in browse mode. 2). [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared
    For any other regular select statements the previous code works.  Does anyone know for sure if a "select into" statement is not possible using the DI API?

    Hi Bill,
    I´m not really sure if select into is avaiable. But here you´ve got a hint: You could use a user defined function to do it, and just call the function from your code.
    SELECT dbo.MyFunction()
    Having this function defined in your SQL Server:
    CREATE function MyFunction ()
    returns char(2)
    AS
    Begin
    select * into ORDR_TEMP from ORDR
    Return ('OK')
    End
    Hope this helps,
    Ibai Peñ

  • Using The Summary Function in ADG

    Hello All,
    Please see my code below. Im using the advance data grid to create a summary row. The summary row currenty SUMs up the 'unqiuevists' and 'redemptions' columns and all is working well.
    What i want to do is then create a 3rd row called 'conversion rate' this conversion rate is a calculation between the uniquevisits and the redemptions columns. If you review the code at the bottom I have managed to create a custom summary func and that function seems to be working fine (using trace)..
    However, I cannot then get the calculated result back into the advance data grid, am i missing something really obvious or is what Im trying to do not possible using the summary row function?
    Please try and help, Ive been on this for days!
    Thanks
    <?xml version="1.0"?>
    <!-- dpcontrols/adg/SummaryGroupADGCustomSummary.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="createGrouping(dpFlat)">
        <mx:Script>
            <![CDATA[
                import mx.collections.GroupingField;
                import mx.collections.Grouping;
                import mx.collections.SummaryField;
                import mx.collections.SummaryRow;
                import mx.collections.GroupingCollection;
                import mx.collections.ArrayCollection;
                import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
                import mx.collections.IViewCursor;    
                import mx.collections.SummaryObject;
                private var groupingCollection:GroupingCollection = new GroupingCollection();
                private function createGrouping(tmpArray:ArrayCollection):GroupingCollection
                    groupingCollection.source = tmpArray;
                    var summaryRow:SummaryRow = new SummaryRow;
                    var summaryField:SummaryField = new SummaryField;
                    summaryField.dataField="redemptions";
                    summaryField.operation="SUM";
                    var summaryField1:SummaryField = new SummaryField;
                    summaryField1.dataField="newvisits";
                    summaryField1.operation="SUM";
                    var summaryField2:SummaryField = new SummaryField;
                    summaryField2.dataField="conversionrate";
                    summaryField2.summaryFunction = summFunc;
                    summaryRow.fields = [summaryField,summaryField1,summaryField2];
                    summaryRow.summaryPlacement = "group";
                    summaryRow.summaryObjectFunction = summObjFunc;
                    var grouping:Grouping = new Grouping();
                    var groupingField:GroupingField = new GroupingField("site");
                    var groupingField1:GroupingField = new GroupingField("merchant");
                    grouping.fields=[groupingField,groupingField1];
                    groupingField.summaries = [summaryRow];
                    groupingField1.summaries = [summaryRow];
                    groupingCollection.grouping = grouping;
                    groupingCollection.refresh();
                    return groupingCollection;
               [Bindable]
                private var dpFlat:ArrayCollection = new ArrayCollection([
                  {site:"BBVA", merchant:"TALLINK", Offer:"10% Off", newvisits:38865, redemptions:40000},
                  {site:"BBVA", merchant:"LIVEIT", Offer:"10% Off", newvisits:29885, redemptions:30000}, 
                  {site:"CartaSi", merchant:"Central California", Offer:"10% Off", newvisits:29134, redemptions:30000}, 
                  {site:"CartaSi", merchant:"Nevada", Offer:"10% Off", newvisits:52888, redemptions:45000}, 
                  {site:"BarclayCard", merchant:"Northern California", Offer:"10% Off", newvisits:38805, redemptions:40000},
                  {site:"BarclayCard", merchant:"Northern California", Offer:"10% Off", newvisits:55498, redemptions:40000}, 
                  {site:"Nordea", merchant:"Southern California", Offer:"10% Off", newvisits:44985, redemptions:45000},
                  {site:"Nordea", merchant:"Southern California", Offer:"10% Off", newvisits:44913, redemptions:45000},
                  {site:"BBVA", merchant:"TALLINK", Offer:"10% Off", newvisits:38865, redemptions:40000},
                  {site:"BBVA", merchant:"LIVEIT", Offer:"10% Off", newvisits:29885, redemptions:30000}, 
                  {site:"CartaSi", merchant:"Central California", Offer:"10% Off", newvisits:29134, redemptions:30000}, 
                  {site:"CartaSi", merchant:"Nevada", Offer:"10% Off", newvisits:52888, redemptions:45000}, 
                  {site:"BarclayCard", merchant:"Northern California", Offer:"10% Off", newvisits:38805, redemptions:40000},
                  {site:"BarclayCard", merchant:"Northern California", Offer:"10% Off", newvisits:55498, redemptions:40000}, 
                  {site:"Nordea", merchant:"Southern California", Offer:"10% Off", newvisits:44985, redemptions:45000},
                  {site:"Nordea", merchant:"Southern California", Offer:"10% Off", newvisits:44913, redemptions:45000},
                private function summFunc(cursor:IViewCursor, dataField:String,
                    operation:String):Number {
                    var conversionrate:Number = 0;
                    conversionrate +=  (cursor.current["redemptions"] / cursor.current["newvisits"]) * 100
                    trace (dataField)
                    trace (conversionrate);      
                    return conversionrate;
                 private function summObjFunc():SummaryObject {
                    // Define the object containing the summary data.
                    var obj:SummaryObject = new SummaryObject();
                    // Add a field containing a value for the Territory_Rep column.
                    obj.conversionrate2 = "Alternating Reps";
                    return obj;
          ]]>
        </mx:Script>
        <mx:DataGrid id="test" dataProvider="{dpFlat}">
        </mx:DataGrid>
        <mx:AdvancedDataGrid id="myADG"  width="100%" height="100%"  dataProvider="{createGrouping(dpFlat)}">       
            <mx:columns>
                <mx:AdvancedDataGridColumn dataField="site"/>
                <mx:AdvancedDataGridColumn dataField="offer"/>
                <mx:AdvancedDataGridColumn dataField="newvisits"/>
                <mx:AdvancedDataGridColumn dataField="redemptions"/>
                <mx:AdvancedDataGridColumn dataField="conversionrate"/>
                <mx:AdvancedDataGridColumn dataField="conversionrate2"/>
            </mx:columns>
       </mx:AdvancedDataGrid>
        <mx:Button label="Button" click="groupingCollection.refresh()"/>
    </mx:Application>

    For those who are interested this is the corrected custom summary function -
    private function summFunc(cursor:IViewCursor, dataField:String,
                    operation:String):Number {
                    var totalNewVisits:Number = 0
                    var totalNewRedemptions:Number = 0
                    var tmpVisits:Number = 0;
                    var tmpRedemptions:Number = 0;      
                    while (!cursor.afterLast)
                        tmpVisits = cursor.current["newvisits"];
                        totalNewVisits += tmpVisits;
                        tmpRedemptions = cursor.current["redemptions"];
                        totalNewRedemptions += tmpRedemptions;
                        cursor.moveNext()
                    var conversionrate:Number = 0;
                    conversionrate =  (totalNewRedemptions / totalNewVisits) * 100
                    return conversionrate;

  • Can I use the FLVTagScriptDataObject to call a function when the netstream byte parser gets to it?

    Hi,
    I am trying to trigger an event when the netstream begins to play a certain portion of a flv file that is being fed into the stream via the appendBytes method.  Is there anyway to feed the event, or a function, or any means of communicating that playback has reached this point into the byte parser?  I figured it would be possible using the FLVTagScriptDataObject but I cannot get any sort of callback when I pass the bytes generated from the tag into the appendBytes method.
    var dataTag:FLVTagScriptDataObject = new FLVTagScriptDataObject();
                dataTag.objects = [{"textData":"text"}];
                var bytes:ByteArray = new ByteArray();
                dataTag.write(bytes);
                appendBytes(bytes);
    I tried something like this trying to create a onCuePoint or onTextData callback but I didn't have any success.
    Any pointers?
    Thanks.

    I found a code example in the HTTPNetStream.as around line 1171:
    case HTTPStreamingState.STOP:
                            var playCompleteInfo:Object = new Object();
                            playCompleteInfo.code = NetStreamCodes.NETSTREAM_PLAY_COMPLETE;
                            playCompleteInfo.level = "status";
                            var playCompleteInfoSDOTag:FLVTagScriptDataObject = new FLVTagScriptDataObject();
                            playCompleteInfoSDOTag.objects = ["onPlayStatus", playCompleteInfo];
                            var tagBytes:ByteArray = new ByteArray();
                            playCompleteInfoSDOTag.write(tagBytes);
                               CONFIG::FLASH_10_1
                                appendBytesAction(NetStreamAppendBytesAction.END_SEQUENCE);
                                appendBytesAction(NetStreamAppendBytesAction.RESET_SEEK);
                            attemptAppendBytes(tagBytes);
                            setState(HTTPStreamingState.HALT);
                            break;

Maybe you are looking for

  • FREE check box in PO should be selected by default for specific material

    Hi All, We have a check box  FREE in PO creation - ME21N in the item row  which is selected when ever we want the vendor to supply those items as free. - I have a list ot items which are supplied freely by the vendor which I have to mention in the PO

  • Artwork doesn't xfer to BlackBerry unless its a "Purchased AAC audio file"

    I've got a new BlackBerry Bold. I've had good success transfering my iTunes music to my phone, but I can only transfer album artwork for some of my songs. Only the songs in iTunes that are "Purchased AAC audio file" seem to successfuly transfer to my

  • Considering Airport Express purchase, but have some questions...

    Hi people. As per title. I'm considering purchasing this in the near future, but although i understand how it works, i just have a few questions... 1) The unit has a USB port correct? I have an external HD & DVD drive, scanner and printer aswell as m

  • DVD to DVD copying

    Hi, I have a new Mac Pro with 2 optical drives. Is there a way of directly copying oene to another. In other words I want to duplicate my (home-made) DVDs in one step without going to Disk Utility and making a disk image and all that palaver should b

  • Cant pair divice with macbook air

    cant pair my iphone with my macbook air via bluetooth