Deal with Counter to no of times

Hi All,
My selection screen has vbeln & kunnr as parameter.
When user enters 1st doc as 91000000 etimes a filed in my table zmailhist would be set to 1.
when new doc set to 1 but when same doc set to 2.
How to achieve this...
Rudra, ABAP.

Dear ,
use this logic
TYPES  : BEGIN OF  W_TSP01.
        INCLUDE STRUCTURE  MARA .
TYPES: END OF W_TSP01 .
DATA : IT_TSP01 TYPE STANDARD TABLE OF MARA WITH HEADER LINE  .
DATA : IT_TSP02 TYPE STANDARD TABLE OF MARA WITH HEADER LINE .
DATA : FIELD1(10) TYPE C .
DATA : FIELD2(10) TYPE C .
DATA : CNT TYPE  I .
DATA : V_bismt TYPE MARA-BISMT .
SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE IT_TSP01 .
LOOP AT IT_TSP01.
  IF V_bismt  = IT_TSP01-BISMT  .
    CNT = CNT + 1 .
  ELSE.
    CNT = 1.
  ENDIF.
  V_MATNR  = IT_TSP01-BISMT  .
  WRITE:/ IT_TSP01-BISMT .
  WRITE:   CNT .
ENDLOOP.
insted of bismt check your field  i.e vbeln and see the output .

Similar Messages

  • Dealing with ExtendScript hangs and long processing times?

    Just curious if an ExtendScript for some reason hangs (or takes really long time to run), you just have to kill it externally right? Or is there some other Adobe scripting feature I'm not aware of that deals with that scenario?
    So I'm guessing the best option to deal with hangs or long processing time is to:
    have an external monitoring tool/service to check up on the ExtendScript execution and handle appropriately as needed (kill it, log info)
    use the COM API (e.g. VBScript, though other COM compatible languages ok) or Applescript API (called directly or called by other programming languages) instead of ExtendScript for their additional programming and/or multi-threading capabilities

    Using whose in Snow Leopard is a lot slower for some reason. SInce you are already using a shell script, you might try using find. Various shell scripts to copy, find, move, etc, can also use wildcard characters.

  • Tips for dealing with large channel count on cRio

    Hello, I have a very simple application that takes an analog input using an AI module (9205) from a thermistor and based on the value of the input it sends out a true/false signal using a digital out module (9477). Each cRio chassis will have close to 128 channels, the code being exactly the same for each channel.
    I wonder if anyone has any tips for how I can do this so that I don't have to copy and paste each section of code 128 times. Obviously this would be a nightmare if the code ever had to be changed. I'm sure there is a way to make a function or a class but being new to graphical programming I can't think of a good way to do this. I looked for a way to dynamically select a channel but can't seem to find anything, if I could select the channel dynamically I'm guessing I can create a subvi and do it that way. Any tips or help would be greatly appreciated.

    There isn't a way to dynamically choose a channel at runtime.  In order
    for the VI to compile successfully, the compiler must be able to statically
    determine which channel is being read or written in the I/O Node at
    compile time.  However, that doesn't mean you can't write a reusable
    subvi.  If you right click on the FPGA I/O In terminal of the I/O Node and create a constant or control, you should be able to reuse the same logic for all of your channels.  The attached screen shot should illustrate the basics of what this might look like.  If you right click the I/O control/constant and select "Configure I/O Type...", you can configure the interface the I/O Item must support in order for it to be selectable from the control.  While this helps single source some of the logic, you will still eventually need 128 I/O constants somewhere in your FPGA VI hierarchy.
    I should also mention that if each channel being read from the 9205 is contained in a separate subVI or I/O Node, you will also incur some execution time overhead due to the scanning nature of the module.  You mentioned you are reading temperature signals so the additional execution time may not be that important to you.  If it is, you may want to look at the IO Sample Method.  You can find more information and examples on how to use this method in the LV help.  Using the IO Sample Method does allow you to dynamically choose a channel at runtime and is generally more efficient for high channel counts.  However, it's also a lot more complicated to use than the I/O Node.
    You also mentioned concerns about the size of arrays and the performance implications of using a single for loop to iterate across your data set.  That's the classic design trade off when dealing with FPGAs.  If you want to perform as much in parallel as possible, you'll need to store all 128 data points from the 9205 modules at once, process the data in parallel using 128 instances of the same circuit, and then output a digital value based on the result.  If you're using fixed point data types, that's 182 x 26 bits for just the I/O data from the 9205.  While this will yield the fastest execution times, the resulting VI may be too large to fit on your target.  Conversely, you could use the IO Sample Method to read each channel one at a time, process the data using the same circuit, and then output a digital value.  This strategy will use the least amount of logic on the FPGA but will also take the longest to execute.  Of course, there are all sorts of options you could create in between these two extremes.  Without knowing more about your requirements, it's hard to advise which end of the spectrum you should shoot for.  Anyway, hopefully this will give you some ideas on where to get started.
    Attachments:
    IO Constant.JPG ‏31 KB

  • How to deal with deadlock on wwv_flow_data table when http server times out

    There are some threads about a deadlock on the wwv_flow_data table. None of them contain a real explanation for this behaviour. In my case I will try to explain what I think is happening. Maybe it helps somebody who is hitting the same matter.
    In my case with APEX 3.2.1 I am navigating from one page to another. Doing this APEX will lock the table wwv_flow_data. As soon as the other page is shown the lock will be released. But now this other page contains a bad performing query (standaard report region). After 5 minutes the http server (modplsql) will time out and present the message "No response from the application server" on the screen. In the meanwhile the query is still running on the database server and the lock stays on the wwv_flow_data table.
    Normal user behaviour will be that the user will use the back button to return to the previous page and tries it again to navigate to the other page or
    the user will try to refresh the page with the bad performing query.
    And voila now you will have a deadlock on the wwv_flow_data table since a second session is trying to do the same thing while the first hasn't finished yet.
    How to deal with it?
    First of all. Have a good look at the bad performing query. Maybe you can improve it that it will succeed before the http server will timeout.
    In my case the 11gr1 optimizer couldn't handle a subquery factoring clause in the best way. After changing it back to a classical inline query the problem was solved.
    Secondly you could increase the timeout parameter of the http server. Although this not the best way.
    Maybe it would better if APEX in a next version would release the lock on the table wwv_flow_date earlier or do a rollback just before the moment that the http server is timing out.
    regards,
    Mathieu Meeuwissen

    Hello Shmoove,
    I saw your reply here and you probably understand the problems the HTTP 100 response may cause.
    I am trying to send image that was taken by getSnapshot. The problem is that the server respond with this HTTP 100 message.
    I suspect that the reason that my server doesn't recognize the file that I'm sending from J2me is that the "server to client" response to the 100 message comes after the second message of (see what the TCPIP viewer shows down here):
    POST /up01/up02.aspx HTTP/1.1
    Content-Type: multipart/form-data; boundary=xxxxyyyyzzz
    Connection: Keep-Alive
    Content-length: 6294
    User-Agent: UNTRUSTED/1.0
    Host: szekely.dnsalias.com:80
    Transfer-Encoding: chunked
    400: Client to Server (126 bytes)
    78
    --xxxxyyyyzzz
    Content-Disposition: form-data; name="pic"; filename="david.jpg"
    Content-Type: application/octet-stream
    400: Connected to Server
    400: Server to Client (112 bytes)
    HTTP/1.1 100 Continue
    Server: Microsoft-IIS/5.1
    Date: Wed, 23 Mar 2005 00:47:02 GMT
    X-Powered-By: ASP.NET
    Any help will be appreciated,
    David

  • The problems seems that the free trial what i am constantly paying for may have ran out/free trial time never contacted as i find this online to take to long and to hard to deal with  yet a paying costumer restricted by some weird fault i don't get this t

    the problems seems that the free trial what i am constantly paying for may have ran out/free trial time never contacted as i find this online to take to long and to hard to deal with  yet a paying costumer restricted by some weird fault i don't get this tried every thing how can i be billed and money taken for hired subscription  but end up with a "free trial" that cut me off having withdrawal as i live my life inside Photoshop 

    Use the trackpad to scroll, thats what it was designed for. The scroll bars automatically disappear when not being used and will appear if you scroll up or down using the trackpad.
    This is a user-to-user forum and most people will post on here if they have problems. You very rarely get people posting to say there update went smooth. The fact is the vast majority of Mountain Lion users will not be experiencing any major problems with the OS, or maybe with apps which are not compatible, but thats hardly Apple's fault if developers don't update their apps.

  • Dealing with time code breaks on the source tape

    Some of my source tapes have broken time code, because of "empty space" between recordings. What's the best way to deal with that if you want to be able to automatically recapture video from a tape?
    Thanks.

    There are a few possible solutions depending on what you need from the tapes.
    You can dupe the whole tape onto another camera or deck (via firewire), or use capture now to grab the whole tape. You'll need to edit the preferences to only warn on timecode breaks, and not create new clips at breaks.
    You could also set the FCP capture controls to be a 'non-controllable device', this means you need to hit play on the deck and use 'capture now' in the log and capture window. The only problem with this is that the timecode is not from the tapes, it is generated by FCP to fix the breaks, so batch re-capturing won't work (bad news if the breaks mash up the audio etc).
    Duping the tapes can be done by using just one camera and your mac. Capture via the 'non controllable' device method above. Then drop the footage into a sequence and then print that to tape. Then use this tape to capture from & you have footage that will recapture at a later date if needed.
    Timecode is a real pain if you have many breaks, duping is often the easiest solution.
    There are more posts on this topic on this site, try the using the search.
    Drew

  • How to deal with  time zone while upgrading the database?

    Hi,
    How to deal with time zone while upgrading the database?
    Thanks
    Edited by: user12135020 on Jul 4, 2011 3:06 AM

    Hello,
    I answered to a Wrong post.
    Best regards,
    Jean-Valentin
    Edited by: Lubiez Jean-Valentin on Jul 4, 2011 12:15 PM

  • My Safari software has stopped working.  Every time I try to log in to the internet, I get an error msg dealing with an Apache server.  It just started to happen a week or so ago.  What's going on?

    I have a Safari web browser that I have used since I purchased my Mac in 2008.  Within the last week or so, I have been getting an error message, which says something like it cannot find the Apache back server or something like that.  As a result, I have not been able to enter the web via Safari.  I have Mac OSX, version 10.6.8.  In the past, I needed an update to my operating system software to view on-line videos.  Is there a similar problem with the operating software this time?  Or has Safari gone off the air.  I am utilizing Firefox to enter the web currently and I can continue to use it, but I would like to have a back-up web browser.  Can someone help?
    Jim Glenn

    <<That may be so, but email is an inclusive part of the broadband package.
    If the broadband service  activated on a given date, then the included email facility should be working too. Anything else would be an altogether unacceptable situation for me...unless the broadband had been activated in advance of any agreed date.>>
    I totally agree with this. Never before have I signed up for a service where email has taken longer to be activated than the broadband connection, in fact, it's been the total opposite, all my past providers activated my email account before the broadband was activated and I was able to start using the address immediately so that by the time bb was enabled, I was ll and truly up and running.
    I do not want a hotmail account or any other type of email account, I want to use what I am paying for, btinternet.
    So far, am not a happy customer and am beginning to wonder if I should have gone with another provider.
    Sorry for the rant but I expect more from such a big company.
    Alison.
    From Alison, sent from my iPad 2

  • Literally the worst customer support experience I've ever had to deal with -- Why don't they let their customers speak to supervisors on demand?

    Call 1: I spoke to them to see if I was eligible for an upgrade. It turned out they had accidentally counted a temporary phone switch to an old device as an upgrade. The representative was extremely slow minded and took over an hour to read through my notes and process what I was saying happened, consulting with his supervisor multiple times. He claimed to have noted everything and told me I had to go to a verizon store to verify in person that I was still using my original phone, and that then I would be able to get an upgrade immediately.
    Trip to the store: Drove an hour only to be told by the store rep that there were NO NOTES on my account about the issue and there was nothing he could do to help me and that I'd have to call customer support again. The store was closing in 20 mins and customer support seems to take 45 minutes minimum to resolve anything, so I left.
    Call 2: Asked a woman to speak to a supervisor about the guy who wasted 2+ hours of my life and gas money. She put me on hold for a long time, came back and said they were all busy right now, would I like to leave my complaint with her? I said no thank you, I will keep waiting. She said ok, and proceeded to hang up.
    Call 3: Asked a different woman to speak to a supervisor, she put me on hold for a long time and then told me that since I wasn't an authorized user I could not speak to one... lol ok. Had a family member call and authorize me.
    Call 4: Asked a guy to speak to a manager. He insisted on taking the complaint himself. Why would I trust someone to take a complaint about their colleague possibly sitting a few desks away when many of them have proven to be incredibly incompetent already? It sounded like we were making progress... then he hung up too.
    Call 5: Asked yet another woman to speak to the manager. She demanded a reason, I told her it was to make a complaint and she told me about a dozen times that the managers would just tell her to take the complaint. I insisted, she refused... finally I threatened to close all of our accounts unless she let me speak to a manager. She said they couldn't right now since the office was closing soon, but that one would call me within 24-48 hours. I'd bet my life savings that never happens. At that point I tried to talk to her about the original upgrade issue, and she said her system had suddenly crashed and that I'd have to call back the next day...  Seriously???
    Absolutely unreal how horrible their customer support is. Will be switching to T-Mobile immediately.

    Having worked in customer service, I have some experience with this kind of situation.  Reps are typically trained to make all attempts to handle complaints by themselves, because there are obviously many more reps than supervisors.  They're usually REQUIRED to fully authorize the account and to get the whole situation from the customer prior to referring you to a supervisor.  One of the biggest problems is that many customers think that demanding a supervisor is a way to guarantee you will get what you want.  If the reason for your request to escalate isn't a valid one, the supervisor won't give in to you either.
    There are plenty of times in my own experience, especially as a brand new rep out of training, that I took a long time to research and get an understanding of the issue.  Yes, I wasn't moving at light speed, but that doesn't make me an idiot.  It means I was trying to gather as much info s possible to try and deal with the issue. But I had plenty of customers tell me I was stupid and to transfer them to my supervisor, simply because I took longer than their patience could tolerate to get all the details I needed.
    I have never had a job that I executed flawlessly day in and day out.  Maybe you have and that's why you can't tolerate a person taking a little longer to wrap their head around the issue, but I'd rather doubt it.
    I also don't think you will find reps who work at light speed and utilize a magic wand to fix people's issues at T-Mobile, either, but I guess it never hurts to try.
    Just to clarify: I do not work for Verizon and never have.  I worked for a residential phone and internet company.

  • Issues with changing connection at run-time

    Post Author: dmazourick
    CA Forum: Data Connectivity and SQL
    Weu2019ve tried a lot of different ways to resolve this issue, but are getting every time the different result.
    Probably someone deal with that issue before and know how to correctly resolve it.
    Weu2019re using Crystal Reports Runtime Components X+ (X, XI, XI R2) u2013 all of them has this issue.
    We need client application to connect to multiple data sources u2013 user chooses report, chooses data source and we show the report for specified data source.
    The data sources are tables or stored procedures stored in different databases on different servers.
    For sure, every data source for a single report has the same structure, but that doesnu2019t matter.
    The issue is: when the name of the database on one server is the same as the name of database on second server, the connection caching occurs.
    How we can check that:
    1.       Weu2019re running report for Server1:<DBN> - report shows data from Server1.
    2.       Weu2019re opening second report for Server2:<DBN> - report shows data from Server1.
    3.       Weu2019re closing application and run 1-2 in opposite order, now both reports show data from Server2.
    Weu2019ve tried different approaches u2013 below is a code sample that opens the report for specific connection.
    Juts to be sure that no one will ask u2013 u201CAre you sure youu2019re passing the correct connection info etc.u201D. Yes! We are sure because weu2019re trying to fix this issue for a long time and tried a lot of different approaches and still cannot find the right solution.
    The code looks like below. This is VB6 code, but also the same situation was tried on VC++ 6.0
    Weu2019re not looking into CR.NET solution for now.
    =================================================
    Sub DisplayReport(Server as String, DB as String, UID as String, PWD as String, viewer as Object)
        Dim app As New CRAXDRT.Application
        Dim report As CRAXDRT.report
        Dim database As CRAXDRT.database
        Dim table As CRAXDRT.DatabaseTable
        Dim par As CRAXDRT.ParameterFieldDefinition
        Set report = app.OpenReport("D:\TestReport_X.rpt")
        report.database.LogOnServer "pdssql.dll", Server, DB, UID, PWD
        Set table = report.database.Tables(1)
        table.SetLogOnInfo Server, DB, UID, PWD
        table.Location = table.Name
        report.database.Verify
        viewer.ReportSource = report
        viewer.ViewReport
    end sub
    =================================================
    The result of above code is the following:
    1.       If we will pass the same viewer and will use different Server u2013 the report will be displayed correctly
    2.       If we will pass different viewers and will use different Server u2013 the reports will contain same data
    The result of above code also depends from the version of Crystal Reports the report was designed in:
    1.       For Report designed in 8.5 u2013 passing of the same viewer with same connection info second time will refresh report
    2.       For Report designed in X, XI, XI R2 u2013 no refresh
    Also, a slight modification of the above code helps for reports designed in XI to work properly, but not for reports designed in X and 8.5:
    1.       Before calling LogonServer, make the following: DB = DB & u201C;u201D & Int(rnd()*32767)
    That makes report designed in XI to display properly in different viewers, but doesnu2019t have any impact to X and no any impact to 8.5
    Weu2019re really looking for any help in this question

    Post Author: fburch
    CA Forum: Data Connectivity and SQL
    I am having similar problems and some successes.
    I have 70+ reports and now suddenly I want to point them at two different servers, but at databases with the same name like you talked about.
    I first just tried the following:
    #1. Load report:
    Dim myReport As New ReportDocument
    myReport.Load(filename)
    #2. Pass in parameter values
    ''Get the collection of parameters from the report
    Dim crParameterFieldDefinitions As ParameterFieldDefinitions = r.DataDefinition.ParameterFields
    ''Access the specified parameter from the collection
    Dim crParameter1 As ParameterFieldDefinition = crParameterFieldDefinitions.Item(ParamName)
    ''Get the current values from the parameter field. At this point
    ''there are zero values set.
    'crParameter1Values = crParameter1.CurrentValues
    ''Set the current values for the parameter field
    Dim crDiscrete1Value As New ParameterDiscreteValue
    If crParameter1.ValueType = FieldValueType.DateField Or crParameter1.ValueType = FieldValueType.DateTimeField Then
    If ParamValue Is System.DBNull.Value Then
    crDiscrete1Value.Value = CDate("1/1/1900")
    ElseIf ParamValue Is Nothing Then
    crDiscrete1Value.Value = CDate("1/1/1900")
    Else
    crDiscrete1Value.Value = ParamValue
    End If
    ElseIf crParameter1.ValueType = FieldValueType.StringField Then
    If ParamValue Is Nothing Then
    crDiscrete1Value.Value = ""
    Else
    crDiscrete1Value.Value = ParamValue
    End If
    ElseIf crParameter1.ValueType = FieldValueType.BooleanField Then
    If ParamValue Is Nothing Then
    crDiscrete1Value.Value = False
    ElseIf ParamValue.ToString.ToUpper = "TRUE" Then
    crDiscrete1Value.Value = True
    Else
    crDiscrete1Value.Value = False
    End If
    ElseIf crParameter1.ValueType = FieldValueType.NumberField Then
    If ParamValue Is Nothing Then
    crDiscrete1Value.Value = 0
    Else
    crDiscrete1Value.Value = ParamValue
    End If
    Else
    If ParamValue Is System.DBNull.Value Then
    crDiscrete1Value.Value = Nothing
    ElseIf ParamValue Is Nothing Then
    crDiscrete1Value.Value = Nothing
    Else
    crDiscrete1Value.Value = ParamValue
    End If
    End If
    ''Add the first current value for the parameter field
    Dim crParameter1Values As New ParameterValues
    crParameter1Values.Add(crDiscrete1Value)
    ''All current parameter values must be applied for the parameter field.
    crParameter1.ApplyCurrentValues(crParameter1Values)
    #3 Set "Table Log in info" (most of my reports using stored procedures, but I guess I still needed this step).
    Dim CrTables As Tables = r.Database.Tables
    Dim CrTable As Table
    Dim crtableLogoninfos As New TableLogOnInfos()
    Dim crtableLogoninfo As New TableLogOnInfo()
    With crConnectionInfo
    .ServerName = connectionParser.GetServerName(connectionString)
    .DatabaseName = connectionParser.GetDatabaseName(connectionString)
    If connectionParser.DoesUseIntegratedSecurity(connectionString) = True Then
    .IntegratedSecurity = True
    Else
    .UserID = connectionParser.GetServerUserName(connectionString)
    .Password = connectionParser.GetServerPassword(connectionString)
    .IntegratedSecurity = False
    End If
    End With
    For Each CrTable In CrTables
    crtableLogoninfo = CrTable.LogOnInfo
    crtableLogoninfo.ConnectionInfo = crConnectionInfo
    CrTable.ApplyLogOnInfo(crtableLogoninfo)
    If InStr(CrTable.Location, ".dbo.") = 0 Then
    CrTable.Location = crConnectionInfo.DatabaseName + ".dbo." + CrTable.Location
    End If
    Next
    If r.Subreports.Count > 0 Then
    Dim crSections As Sections
    Dim crSection As Section
    Dim crReportObjects As ReportObjects
    Dim crReportObject As ReportObject
    Dim crSubreportObject As SubreportObject
    Dim crDatabase As Database
    Dim subRepDoc As New ReportDocument()
    'SUBREPORTS
    'Set the sections collection with report sections
    crSections = r.ReportDefinition.Sections
    'Loop through each section and find all the report objects
    'Loop through all the report objects to find all subreport objects, then set the
    'logoninfo to the subreport
    For Each crSection In crSections
    crReportObjects = crSection.ReportObjects
    For Each crReportObject In crReportObjects
    If crReportObject.Kind = ReportObjectKind.SubreportObject Then
    'If you find a subreport, typecast the reportobject to a subreport object
    crSubreportObject = CType(crReportObject, SubreportObject)
    'Open the subreport
    subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
    crDatabase = subRepDoc.Database
    CrTables = crDatabase.Tables
    'Loop through each table and set the connection info
    'Pass the connection info to the logoninfo object then apply the
    'logoninfo to the subreport
    For Each CrTable In CrTables
    crtableLogoninfo = CrTable.LogOnInfo
    crtableLogoninfo.ConnectionInfo = crConnectionInfo
    CrTable.ApplyLogOnInfo(crtableLogoninfo)
    If InStr(CrTable.Location, ".dbo.") = 0 Then
    CrTable.Location = crConnectionInfo.DatabaseName + ".dbo." + CrTable.Location
    End If
    Next
    End If
    Next
    Next
    #4 go get the data
    crv.ReportSource = myReport
    crv.Refresh()
    #5 Call export to disk function.
    This was not changing server - did not realize it was a caching problem as you suggested. That makes sense. So anyway, then of course I threw a verify database statement on there, before I get the data. Now looks like this:
    #1 Load Report
    #2. Pass in parameter values (dummy values that will generate schema of table without having to actually run long running procedures, i.e. select (cast 1 as int) as somefield1, cast(2.0 as numeric(10,0)) as somefield2
    #3 Set "Table Log in info"
    #3b Verify the database which seems to be a necessity:
    myReport.VerifyDatabase()
    #3c Re-populate the report with real parameter values, same as #2 but this time with the ones that will generate the real data
    #4 go get the data
    #5 Call export to disk function.
    This does work, some of the time. When the datasource underlying report are tables, it works. I made a dummy crystal report with lots of different types of params (stored procedure underlying database) - this also worked!
    Unfortunately, when I run this against the majority of my reports, I get this stupid "invalid mapping type value", for which I have not been able to resolve yet.
    I also tried putting a myreport.SetDatabaseLogon("","") -- what would this do, clear it out? (saw this referenced somewhere).
    Then I tried putting the real connection info in there as well ...
    myReport.SetDatabaseLogon(uid, pwd, serverName, DBname)
    I put this setdatabase thing before I called verifydatabase, which is where the process is bombing out and giving me invalid mapping type for the reports that do not run.
    At this point I am still working on solution. I have tried creating dummy report that used same parameter types as a report that was failing and voila - the dummy report worked. Anyway, let me know if you get your problem fixed and I will do the same. Looks like you are using a different method that I didn't notice "LogOnServer"

  • Powershell - dealing with {host1, host2, host3, ....}

    Hello,
    I'm working on a Clustered Windows 2012 R2 server, and I'd like to get the list the Preferred Owner list of some cluster Resources, but we have many nodes and the output is not readable from powershell because when use the standard command but it
    shows something like {server1, server2,.....} and the output on the screen is not complete.
    Then I've tried to get the output in table mode, but I don't know how to get it, I've used the following command using a "join" trick and I'm getting more or less what I want.
    get-clusterresource
    |
    Where{$_.resourcetype 
    -match
    "MyResourceType"}
    |
    get-clusterownernode | select clusterobject,,@{n='PrefOwners';e={$_.ownernodes
    -join","}}
    |ft-a
    I've got something like the following, all the Owners are included on a single column. I may survive with this, but I'll have to perform a second filter (excel) over  this output to split each PrefOwner in single columns.
    Resource Name                  PrefOwners
    "Cluster Resource name"    "PrefOwner1,PrefOwner2,PrefOwner3,prefOwner4,PrefOwner5"
    And I'd like to go an step further, what I want is have something like the following where each preferred owner has their own column.
    Resource Name                  owner1            owner2            
    Owner3           .......
    "Cluster Resource name"    "PrefOwner1"   "PrefOwner2"     "PrefOwner3"   .......
    How can I get this type of output on one single command?
    Best Regards
    Regards.

    And what's wrong with multiple commands?
    Your best bet would be to create a custom object with the columns you're after, but that involves iterating through each owner and you won't get it on a single command.
    However, bearing in mind that you're you're using Windows 2012 R2 which comes with PowerShell 4 and that you're quite keen on concise statements, there are things you can do to shorten your version so far (and make it faster! MOAR SPEED!)
    A quick example: since PowerShell v4 you can now invoke a .Where() method on collections. It runs faster than piping it to a Where-Object, does exactly the same thing, and the syntax is pretty much the same too. Here's an example:
    # New PowerShell v4 way, fastest
    (Get-Service).Where({$_.Name -eq 'spooler'})
    # PowerShell v3 way, faster than PS <v3 ways
    Get-Service | Where-Object Name -eq spooler
    # Notice I don't even need to put quotes around the service name, whereas on all the other methods I do. Talk about being lazy!
    # Old way... Slowest one
    Get-Service | Where-Object {$_.Name -eq 'spooler'}
    For comparison, I ran some tests on all 3 ways by invoking each way 10 times and using Measure-Command to capture the times
    The v4 way took 160ms~ to run.
    The v3 way took 350ms~ to run.
    The <v3 way took 450ms~ to run.
    I ran all tests multiple times with consistent results, so there you go!
    Now... as for your custom object, as I said you can't do it in a single call (unless you want to have all your code cluttered in a line with over 200 characters and expect someone to be able to read it - this is not code art (http://www.dalatdesigns.com/blog/?p=11678).
    Anyway, here's a method. I don't have any clusters, so I settled for reading the displaying each of the properties of a WMI instance as one per column, but you get the idea:
    # I *should* have used the -Filter parameter of Get-WmiObject here but am trying to get something as similar to your code as possible
    $Processes = (Get-WmiObject -Class Win32_Process).Where({$_.Name -eq 'PowerShell.exe'})
    #It is better not to use a pipeline here else you have no way of telling when the subproperties you're dealing with now are from the old object or the new one
    foreach ($Process in $Processes)
    $output = @{}
    $output.Name = $Process.Name
    # Normally it would work like this, but in WMI objects you can't retrieve them based on index, only name so... It should work for your objects though, give it a try!
    #for ($i = 0; $i -lt $Process.Properties.Count; $i++)
    #$output."Property$i" = $Process.Properties[$i].Name
    # As in this case we can't reference the property based on an index, we have to take another route...
    $i = 0
    foreach ($Property in $Process.Properties)
    $output."Property$i" = $Property.Name
    $i++
    $outputArray += New-Object -TypeName PSObject -Property $output
    $outputArray | Format-Table *
    Obviously in my particular case the result will be almost unreadable as a table, since there's no more no less than 42 different properties on that object, but hey, this is what you asked for! You deal with it now :D
    PS: I'm just in a good mood today. No idea why, but I am. Please don't follow my 'You deal with it now' to the letter. If you have problems or questions come back!

  • What's best strategy for dealing with 40+ hours of footage

    We have been editing a documentary with 45+ hours of footage and presently have captured roughly 230 gb. Needless to say it's a lot of files. What's the best strategy for dealing with so much captured footage? It's almost impossible to remember it all and labeling it while logging it seems inadequate as it difficult to actually read comments in dozens and dozens of folders.
    Just looking for suggestions on how to deal with this problem for this and future projects.
    G5 Dual Core 2.3   Mac OS X (10.4.6)   2.5 g ram, 2 internal sata 2 250gb

    Ditto, ditto, ditto on all of the previous posts. I've done four long form documentaries.
    First I listen to all the the sound bytes and digitize only the ones that I think I will need. I will take in much more than I use, but I like to transcribe bytes from the non-linear timeline. It's easier for me.
    I had so many interviews in the last doc that I gave each interviewee a bin. You must decide how you want to organize the sound bytes. Do you want a bin for each interviewee or do you want to do it by subject. That will depend on you documentary and subject matter.
    I then have b-roll bins. Sometime I base them on location and sometimes I base them on subject matter. This last time I based them on location because I would have a good idea of what was in each bin by remembering where and when it was shot.
    Perhaps, you weren't at the shoot and do not have this advantage. It's crucial that you organize you b-roll bins in a way that makes sense to you.
    I then have music bins and bins for my voice over.
    Many folks recommend that you work in small sequences and nest. This is a good idea for long form stuff. That way you don't get lost in the timeline.
    I also make a "used" bin. Once I've used a shot I pull it out of the bin and put it "away" That keeps me from repeatedly looking at footage that I've already used.
    The previous posts are right. If you've digitized 45 hours of footage you've put in too much. It's time to start deleting some media. Remember that when you hit the edit suite, you should be one the downhill slide. You should have a script and a clear idea of where you're going.
    I don't have enough fingers to count the number of times that I've had producers walk into my edit suite with a bunch of raw tape and tell me that that "want to make something cool." They generally have no idea where they're going and end up wondering why the process is so hard.
    Refine your story and base your clip selections on that story.
    Good luck
    Dual 2 GHz Power Mac G5   Mac OS X (10.4.8)  

  • Dealing with large files, again

    Ok, so I've looked into using BufferedReaders and can't get my head round them; or more specifically, I can't work out how to apply them to my code.
    I have inserted a section of my code below, and want to change it so that I can read in large files (of over 5 million lines of text). I am reading the data into different arrays and then processing them. Obvioulsy, when reading in such large files, my arrays are filling up and failing.
    Can anyone suggest how to read the file into a buffer, deal with a set amount of data, process it, empty the arrays, then read in the next lot?
    Any ideas?
    void readV2(){
         String line;
         int i=0,lineNo=0;
            try {
              //Create input stream
                FileReader fr = new FileReader(inputFile);
                 BufferedReader buff = new BufferedReader(fr);
                while((line = buff.readLine()) != null) {
              if(line.substring(0,2).equals("V2")){
                     lineNo = lineNo+1;
              IL[i] = Integer.parseInt(line.substring(8,15).trim());
                    //Other processing here
                     NoOfPairs = NoOfPairs+1;
                     }//end if
                     else{
                      break;
            }//end while
            buff.close();
            fr.close();
            }//end try
            catch  (IOException e) {
            log.append("IOException error in readESSOV2XY" + e + newline);
            proceed=false;
            }//end catch IOException
            catch (ArrayIndexOutOfBoundsException e) {
                   arrayIndexOutOfBoundsError(lineNo);
         }//end catch ArrayIndexOutOfBoundsException
         catch (StringIndexOutOfBoundsException e) {
              stringIndexOutOfBoundsError(e.getMessage(),lineNo);
    }//end V2Many thanks for any help!
    Tim

    Yeah, ok, so that seems simple enough.
    But once I have read part of the file into my program,
    I need to call another method to deal with the data I
    have read in and write it out to an output file.
    How do I get my file reader to "remember" where I am
    up to in the file I'm reading?
    An obvious way, but possibly not too good technically,
    would be to set a counter and when I go back to the
    fiel reader, skip that number of lines in the inpuit
    file.
    This just doesn't seem too efficient, which is
    critical when it comes to dealing with such large
    files (i.e. several million lines long)I think you might need to change the way you are thinking about streams. The objective of a stream is to read and process data at the same time.
    I would recommend that you re-think your algorithm : instead of reading the whole file, then doing your processing - think about how you could read a line and process a line, then read the next line, etc...
    By working on just the pieces of data that you have just read, you can process huge files with almost no memory requirements.
    As a rule of thumb, if you ever find yourself creating huge arrays to hold data from a file, chances are pretty good that there is a better way. Sometimes you need to buffer things, but very rarely do you need to buffer such huge pieces.
    - K

  • 1z0-051 Dealing with the exam

    Hi
    I'm preparing 4 1z0-051 exam and i want to master dealing with multi choice questions and lab question and all the detail about the exam technics not the books or references
    thank you

    Amr Halima wrote:
    thnk you for response I've read the resources you support me with, and still have some questions:
    1) How can i review the unmarked questions if i discover that my answer is wrong ??
    Its actually a while since i took an oracle cert exam, and the last one i took the 'skin' had changed so it was a little different to the classic style. But the basics are the same.
    I dont have a exam in front of me as i write this.
    There are buttons to go through to NEXT and PREVIOUS questions. If you are at the end of the exam and wish to go to the beginning the thats a lot of previous buttons. But you an goto the review page at the end and jump to the question you require.
    You have the option of tagging any as marked for review. The idea is if you have time at the end you can focus your review the questions you have tagged
    The final page (and there may well be a button to go this on every page, but dont quote me) while have the means to select
    whether you wish to review all questions: all 'unmarked' questions, or 'all tagged for review' questions. The way this worked varied
    on the last exam i took; the previous classic style use to show all questions with a checked and a colour to show if the question
    had been answered and had been tagged for review. The last exam i took i think the final page worked with buttons used to filter
    the questions it dsipayed to just to from between:
    - All questions
    - Questions not fully answered.
    - Questions not tagged for review.
    A question is not fully answered if the candidate has not given a sufficient number of answers to which satisfies the question criteria.
    To demonstrate this:
    - Let us consider the question:
    Q.34 Choose the following cities where they are not the capital city of the associated country:
    A: Dublin is the capital city of the Republic of Ireland
    B: Beijing is the capital city of India
    C: Moscow is the capital city of Russia
    D: Washington is the capital of England
    Select the best two answers:Notes:
    (1) Now B and D are obviously the correct answers, and A and C incorrect.
    (2) Be aware that maybe 3% of candidates as this point would have failed to read the question correctly and will mark A and C as correct, +(Quote(my old Chemistry teacher): if all else fails read the question)+.
    (3) If the candidate only checked one answer, say 'C' then this question would appear on the list of unmarked questions for review and the candidate would not receive marks for the question.
    (4) The the question had said select one or more correct answers and the candidate had checked C only, then the question would NOT appear on the list of unmarked questions. In general high exams such as OCP will contain more questions of the form select one or more possible answers.
    You may find it is possible to grey incorrect answers by right clicking them. This can be useful to focus on the correct answers. You can actually do the same thing by writing it on the marker board you are given.
    Let us say I come to the question above. Let us say I know for sure 'C' that Russia is the capital of Moscow is true so i eliminate that (Either right to grey it out or write Q34: C-X on my marker board. I know London is the Capital of England so therefore +D: Washington is the capital of england so i check 'D' as I know that is correct.  But let us say i am not sure about A B, which is true and which is false.
    - I mark this question for review as I am not sure about it and perhaps it is worth coming back to later +(If I have time)+. I might make a mark Q34 capitals on by marker board so i know which one to come back to. Even if i dont know the last answer i need to mark i will have wanted to have guessed it by the time i finished the exam. I would certainly want to have made a guess by the end of the exam, so if i am running short of time i would guess as I might not have time to return, if i am well up on time i might leave it unmarked for now.
    - One danger of greying out incorrect answers is one may forget to check the correct answers. I remember finishing an exam and discovering on the review screen i had not answered a question. I had greyed out the wrong answers but forgotten to check the right answers! i would have gotten no marked, as it is checked answers that count. Please be aware greying out of answers are only a help to the candidate and may not be present on all exams
    - Sometimes drag and drop answers may also be present. There may also be exhibits to view; and you should note how these may be tiled onto the screen. Beware of spending too much time looking at these.
    2) for multi choice questions if i have a - choose all that apply- question and i've chose just one answer and it was right .Do I take a part of the mark of the question??
    and if i chose all the right answers and one wrong .Do i loose all the mark of the question??In all cases if you fail to select all correct answers you will recieve no marks for the question
    >
    what's the grading policy?? i didn't find a topic about this
    With Oracle Certification exams one either passes or fails. The pass percentage appears on your exam score report. It does not appear on your certification. The pass mark is chosen after reviewing the exam at the end of beta testing stage, and may be adjusted in production if a revision is demeed necessary.
    >
    thank you

  • Dealing with hard timeout of guarded service

    Hi, I'm investigating the behavior the cause of and subsequent behavior after a hard timeout of a guarded service. In my experience, the grid members are unable to recover properly. I am trying to figure out whether there is something in our configuration that may be aggravating the situation, and also see whether I might be able to improve the behavior of our client code.
    What I have done is purposely lower the service guardian's timeout, to about 25 seconds, so that a certain EntryProcessor will always time-out. The behavior I see after the timeout is very similar to the behavior we see when the problem crops up in the real world. I know that I can raise the timeout or use the PriorityTask API, but even if I do that, we may run into timeouts due to deadlock. If that happens, I want to know what I can expect the grid to do.
    Here's what I'm seeing:
    I am running 2 storage-enabled members with backup-count=0. I am running my "client" as a non-storage-enabled member.
    First, the client kicks off the EntryProcessor:
    Map<Object, Integer> readProcessorResult = requestCache.invokeAll(AlwaysFilter.INSTANCE, processor);
    The two members begin logging successful executions of the EntryProcessor. Then, one of the members happens to run it against an entry that takes longer than the service guardian's timeout. We get a soft and hard timeout:
    [ERROR] Coherence: 2012-01-26 10:56:20.103/333.297Oracle Coherence GE 3.7.1.2 <Error> (thread=Cluster, member=1): Detected soft timeout) of {WrapperGuardable Guard{Daemon=DistributedCache:jdw-read-request-service} Service=PartitionedCache{Name=jdw-read-request-service, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=0, AssignedPartitions=128}}
    [WARN ] Coherence: 2012-01-26 10:56:20.121/333.315Oracle Coherence GE 3.7.1.2 <Warning> (thread=Recovery Thread, member=1): Attempting recovery of Guard{Daemon=DistributedCache:jdw-read-request-service}
    [ERROR] Coherence: 2012-01-26 10:56:22.604/335.798Oracle Coherence GE 3.7.1.2 <Error> (thread=Cluster, member=1): Detected hard timeout) of {WrapperGuardable Guard{Daemon=DistributedCache:jdw-read-request-service} Service=PartitionedCache{Name=jdw-read-request-service, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=0, AssignedPartitions=128}}Now, for some reason (why?), Coherence determines that the service is unrecoverable and it must stop the cluster:
    [WARN ] Coherence: 2012-01-26 10:56:22.605/335.799Oracle Coherence GE 3.7.1.2 <Warning> (thread=Termination Thread, member=1): Terminating Guard{Daemon=DistributedCache:jdw-read-request-service}
    Coherence <Error>: Halting this cluster node due to unrecoverable service failure
    [ERROR] Coherence: 2012-01-26 10:56:23.613/336.807Oracle Coherence GE 3.7.1.2 <Error> (thread=Cluster, member=1): StopRunning ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=3.7.1, OldestMemberId=1} due to unhandled exception:
    [ERROR] Coherence: 2012-01-26 10:56:23.613/336.807Oracle Coherence GE 3.7.1.2 <Error> (thread=PacketListener1P, member=1): Stopping cluster due to unhandled exception: com.tangosol.net.messaging.ConnectionException: UdpSocket.receive: unable to reopen socket; State=STATE_CLOSED
            at com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:58)
            at com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
            at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
            at java.lang.Thread.run(Unknown Source)
    [ERROR] Coherence: 2012-01-26 10:56:23.641/336.835Oracle Coherence GE 3.7.1.2 <Error> (thread=Cluster, member=n/a):
    java.lang.NullPointerException: null
            at com.tangosol.coherence.component.net.Cluster$ClusterService$TcpRing.onAcceptException(Cluster.CDB:13) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at com.tangosol.coherence.component.net.TcpRing.onAccept(TcpRing.CDB:25) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at com.tangosol.coherence.component.net.TcpRing.onSelect(TcpRing.CDB:27) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at com.tangosol.coherence.component.net.TcpRing.select(TcpRing.CDB:14) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onWait(ClusterService.CDB:6) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:39) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at java.lang.Thread.run(Unknown Source) [na:1.6.0_30]
    [WARN ] Coherence: 2012-01-26 10:56:24.976/338.170Oracle Coherence GE 3.7.1.2 <Warning> (thread=Invocation:jdw-invocation-service, member=n/a): failed to stop 95 worker threads; abandoning
    Coherence <Error>: Halted the cluster:
    Cluster is not running: State=5
    Exception in thread "Cluster|SERVICE_STOPPED|Member(Id=1, Timestamp=2012-01-26 10:50:58.044, Address=192.168.1.67:9001, MachineId=52295, Location=site:,machine:DEN12956L,process:10012, Role=CoherenceServer)" java.nio.channels.ClosedSelector
    Exception
            at sun.nio.ch.SelectorImpl.keys(Unknown Source)
            at com.tangosol.coherence.component.net.TcpRing.disconnectAll(TcpRing.CDB:6)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService$TcpRing.onLeft(ClusterService.CDB:4)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onStopRunning(ClusterService.CDB:7)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onException(ClusterService.CDB:28)
            at com.tangosol.coherence.component.net.Cluster$ClusterService.onException(Cluster.CDB:7)
            at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:85)
    [ERROR] Coherence: 2012-01-26 10:56:25.616/338.810 Oracle Coherence GE 3.7.1.2 <Error> (thread=Cluster, member=n/a): StopRunning ClusterService{Name=Cluster, State=(SERVICE_STOPPED, STATE_JOINED), Id=0, Version=3.7.1} due to unhandled exception:
            at java.lang.Thread.run(Unknown Source)
    [ERROR] Coherence: 2012-01-26 10:56:25.616/338.810Oracle Coherence GE 3.7.1.2 <Error> (thread=Cluster, member=n/a):
    java.nio.channels.ClosedSelectorException: null
            at sun.nio.ch.SelectorImpl.keys(Unknown Source) ~[na:1.6.0_30]
            at com.tangosol.coherence.component.net.TcpRing.close(TcpRing.CDB:11) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onExit(ClusterService.CDB:1) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:68) ~[coherence-3.7.1.2.jar:3.7.1.2]
            at java.lang.Thread.run(Unknown Source) [na:1.6.0_30]Around the same time that member 1 decided to stop its cluster, member 2, which had been happily executing entry processors, begins taking responsibility for member 1's partitions. That's what I'd expect.
    [WARN ] Coherence: 2012-01-26 10:56:23.643/336.784Oracle Coherence GE 3.7.1.2 <Warning> (thread=DistributedCache:sys-id-dist-service, member=2): Assigned 128 orphaned primary partitions
    [WARN ] Coherence: 2012-01-26 10:56:23.646/336.787Oracle Coherence GE 3.7.1.2 <Warning> thread=DistributedCache:sourceMetadataReviewCache-service, member=2): Assigned 128 orphaned primary partitions
    ......Member 1 now restarts its cluster and re-joins as member 4, and starts re-starting its services:
    [INFO ] Coherence: 2012-01-26 10:56:26.008/339.202Oracle Coherence GE 3.7.1.2 <Info> (thread=main, member=n/a): Restarting cluster
    [INFO ] Coherence: 2012-01-26 10:56:26.327/339.521Oracle Coherence GE 3.7.1.2 <Info> (thread=Cluster, member=n/a): This Member(Id=4, Timestamp=2012-01-26 10:56:26.126, Address=192.168.1.67:9001, MachineId=52295, Location=site:,machine:DEN12956L,process:10012, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "NIR_GRID_DEV" with senior Member(Id=2, Timestamp=2012-01-26 10:51:03.593, Address=192.168.1.67:9003, MachineId=52295, Location=site:,machine:DEN12956L,process:10024, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
    [INFO ] Coherence: 2012-01-26 10:56:26.364/339.558Oracle Coherence GE 3.7.1.2 <Info> (thread=main, member=n/a): Started cluster Name=NIR_GRID_DEV
    Group{Address=224.3.7.0, Port=60000, TTL=0}
    MasterMemberSet(
      ThisMember=Member(Id=4, Timestamp=2012-01-26 10:56:26.126, Address=192.168.1.67:9001, MachineId=52295, Location=site:,machine:DEN12956L,process:10012, Role=CoherenceServer)
      OldestMember=Member(Id=2, Timestamp=2012-01-26 10:51:03.593, Address=192.168.1.67:9003, MachineId=52295, Location=site:,machine:DEN12956L,process:10024, Role=CoherenceServer)
      ActualMemberSet=MemberSet(Size=3
        Member(Id=2, Timestamp=2012-01-26 10:51:03.593, Address=192.168.1.67:9003, MachineId=52295, Location=site:,machine:DEN12956L,process:10024, Role=CoherenceServer)
        Member(Id=3, Timestamp=2012-01-26 10:55:05.522, Address=192.168.1.67:9005, MachineId=52295, Location=site:,machine:DEN12956L,process:13268, Role=IntellijRtExecutionAppMain)
        Member(Id=4, Timestamp=2012-01-26 10:56:26.126, Address=192.168.1.67:9001, MachineId=52295, Location=site:,machine:DEN12956L,process:10012, Role=CoherenceServer)
      MemberId|ServiceVersion|ServiceJoined|MemberState
        2|3.7.1|2012-01-26 10:51:03.593|JOINED,
        3|3.7.1|2012-01-26 10:55:05.522|JOINED,
        4|3.7.1|2012-01-26 10:56:26.337|JOINED
      RecycleMillis=1200000
      RecycleSet=MemberSet(Size=0
    TcpRing{Connections=[2, 3]}
    IpMonitor{AddressListSize=0}
    [INFO ] Coherence: 2012-01-26 10:56:26.365/339.559Oracle Coherence GE 3.7.1.2 <Info> (thread=main, member=4): Restarting Service:Management
    [INFO ] Coherence: 2012-01-26 10:56:26.417/339.611Oracle Coherence GE 3.7.1.2 <Info> (thread=main, member=4): Restarting Service:jdwSourceManagerCache-service
    ......While that is happening, member 2 now also encounters a hard timeout on the same service and begins going through the same process that member 1 just went through. I am not sure why member 2 encounters this timeout. Perhaps it is because it ran another entry processor that took too long? It is difficult to tell. Except this time we start having problems when member 2 tries to stop the cluster, and I'm not sure exactly why. Perhaps because member 4 is not yet in a good state?
    [ERROR] Coherence: 2012-01-26 10:56:35.282/348.423Oracle Coherence GE 3.7.1.2 <Error> (thread=PacketListener1, member=2): Stopping cluster due to unhandled exception:
    com.tangosol.net.messaging.ConnectionException: UdpSocket.receive: unable to reopen socket; State=STATE_CLOSED
            at com.tangosol.coherence.component.net.socket.UdpSocket.receive(UdpSocket.CDB:58)
            at com.tangosol.coherence.component.net.UdpPacket.receive(UdpPacket.CDB:1)
            at com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketListener.onNotify(PacketListener.CDB:20)
            at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
            at java.lang.Thread.run(Unknown Source)
    Coherence <Error>: Halted the cluster:
    Cluster is not running: State=5
    [ERROR] Coherence: 2012-01-26 10:56:42.147/355.288Oracle Coherence GE 3.7.1.2 <Error> (thread=main, member=n/a): Failed to restart services: com.tangosol.net.RequestTimeoutException: Timeout while waiting for cluster to stop.
    [ERROR] Coherence: 2012-01-26 10:56:51.324/364.465Oracle Coherence GE 3.7.1.2 <Error> (thread=main, member=n/a): Failed to restart services: com.tangosol.net.RequestTimeoutException: Timeout while waiting for cluster to stop.
    ...... (error repeats)And the newly re-joined member 4, which had been restarting services and claiming partitions from the newly-dead member 2, appears to restart execution of the entry processor but then complains that its thread was interrupted: I am not sure why this happens or what it means.
    [INFO ] Coherence: 2012-01-26 10:56:52.685/365.879Oracle Coherence GE 3.7.1.2 <Info> (thread=DistributedCache:jdw-read-request-service, member=4): Restarting NamedCache: coherence.common.sequencegenerators
    [ERROR] Coherence: 2012-01-26 10:56:52.686/365.880Oracle Coherence GE 3.7.1.2 <Error> (thread=DistributedCache:jdw-read-request-service, member=4): This thread was interrupted while waiting for the results of a request:
    Poll
      PollId=2, active
      InitTimeMillis=1327597012685
      Service=DistributedCacheForSequenceGenerators (60)
      RespondedMemberSet=[]
      LeftMemberSet=[]
      RemainingMemberSet=[4]
      },Meanwhile, my client, who ran the invoke() with the EntryProcessor, has received a message stating "no storage enabled members exist," which although it may be true doesn't seem like it's really the cause of the problem.
    Could I be having problems because all my cluster members are executing the same kind of long-running EntryProcessor and all of them are getting service guardian timeouts at around the same time? How do I deal with that? For example, what if a database is running very slowly one day and my entry processors all start to execute slowly? I don't want my whole grid having problems. Should I, for example, limit the number of concurrent EntryProcessors to < count of grid members by using a LimitFilter?
    What does it mean that there was a timeout waiting for the cluster to stop?
    And what about the client? If I get an exception after running a grid command, is it valid to wait a few seconds for things to stabilize and then try again? What's my best bet as far as that goes?
    Thanks! And let me know if I should file a support request instead.

    rehevkor5 wrote:
    I appreciate the responses so far, but unfortunately they give me no new information.
    I am aware that I can try to avoid timeouts by using the PriorityTask API and heartbeats, but that still gives me no guarantee that I will not run into a deadlock situation and encounter a timeout. That is fine as long as my grid can deal with it. Currently, it does not behave well when that happens (all members eventually die). I challenge anyone reading this post to try running an entry processor on their grid that is designed to time out (not by using sleep() as that is interruptable via a soft timeout). All your members will probably encounter the timeout at the same time, and it probably will not end well. If, however, you can handle this situation or have some approach that mitigates it, I would love to hear from you!
    I am also aware that I can disable the service guardians, or configure them to only log and take no action. However, this leaves me vulnerable to deadlocks.
    Therefore, I would still appreciate any responses that address either of these two issues:
    1. Configuration changes or other fixes that allow my members to recover successfully from a service timeout
    2. Operational best practices that allow my grid to continue running even if an entry processor that is running on every member of the grid times out at the same time. For example, limiting the number of concurrent entry processors.One operational best practice is design your system so you can't get into a deadlock. If it can get into a deadlock once, it can get into it many times. If a system does that, it is not a well-behaving or well-designed system.
    If your code can get into a deadlock across the cluster, that usually means that you are trying to do something which you should not have, like trying to operate on multiple resources in an arbitrary order while holding locks on them (e.g. violating the threading guidelines), which is the typical case of a distributed deadlock, and against which you can guard with ordering your multiple locking operations in a consistent order, but you should not expect Coherence to retry and possibly get into the same problem, as all you would achieve with it is that you converted the deadlock into a livelock.
    Coherence is not supposed to guard against your errors. With the guardian it gives you a way to find out what your error is, but it should not attempt the impossible by trying to correct it. You should design your system so that it does not have this kinds of errors.
    If you think there is a specific reproducible problem in how Coherence reacts to your code which can bring down the system, then create a test case and submit it in a SR. The kinds of exceptions you get make it possible that it may be necessary. If it is indeed Coherence's fault that it dies and not something you did, then I am fairly certain that it will be given quite high priority considering it is an error which can bring a cluster down.
    Coherence server-side constructs have an API contract. Single foremost aspect of that is that the operations complete without an error (unless otherwise documented) within a small period of time. If it goes against this then it has to provide feedback or customization with PriorityTask/GuardSupport. A code which can deadlock goes against this contract. After all we are speaking about a grid, not a distributed process manager.
    I agree that the grid should not die due to a deadlock, but you should not expect Coherence to fix a deadlock either. But dying due to an exception and having a distributed deadlock is two different and independent issues.
    Best regards,
    Robert
    Edited by: robvarga on Feb 3, 2012 10:12 AM

Maybe you are looking for