Stored procedure runs fine from SSMS but fails when called from the C# app

I'm using SS Express 2012 so I doubt I have all possible debugging capabilities at my disposal, although I'm still trying to figure this out myself.
The compiled C# application has logging to insure that the the SP is being invoked, the appropriate line of code is  definitely being reached. The logging always reports 'success' suggesting that the SP was successfully executed (and no exception is thrown
to the C# app), but the indexes aren't getting rebuilt (I have a fragmentation query proving they are not rebuilt). Yet it runs successfully if I
    (1) set a breakpoint in the C# app and step through the code line by line OR
    (2) run the SP from the SSMS GUI.
The fragmentation query confirms sucess for both 1 and 2.
-I can't rely on the GUI because I want to run this overnight immediately after the C# app is finished inserting new records.
- The SP loops through all the tables, and all the indexes in each table, checking for fragmentation and rebuilding any indexes over 7% fragmented.
ALTER Procedure [dbo].[usp_RebuildIndexes]
AS
Declare @fetch_TableName NVARCHAR(256)
DECLARE Cursor_Tables CURSOR FOR
SELECT Name FROM sysobjects WHERE xtype ='U'
OPEN Cursor_Tables
While 1 = 1 -- Begin to Loop through all tables
BEGIN
FETCH NEXT FROM Cursor_Tables INTO @fetch_TableName -- fetches the next table
if @@FETCH_STATUS <> 0 break
print '---------' + @fetch_TableName
Declare @fetch_indexName NVARCHAR(256) -- loops through al indexes of the current table
DECLARE Cursor_Indexes CURSOR FOR -- Looking for indexes fragmented more than 7 percent.
SELECT name as indexName
FROM sys.dm_db_index_physical_stats (DB_ID(DB_Name()), OBJECT_ID(@fetch_TableName), NULL, NULL, NULL) AS a
JOIN sys.indexes AS b ON a.object_id = b.object_id AND a.index_id = b.index_id
Where Name is not null and avg_fragmentation_in_percent > 7
OPEN Cursor_Indexes
WHILE 1= 1 -- Begin to Loop through all Indexes
BEGIN
FETCH NEXT FROM [Cursor_Indexes] INTO @fetch_indexName
if @@FETCH_STATUS <> 0 break
Declare @SqL nvarchar(2000) = N'ALTER INDEX ' + @fetch_indexName + ' ON ' + DB_Name() + '.dbo.' + @fetch_TableName + ' Rebuild'
print @Sql
Begin TRy
Execute sp_executeSQL @sql
End Try
Begin Catch
Declare @err nvarchar(2000) = ERROR_MESSAGE();
throw 51000, @err, 1
End Catch
End -- Ends looping through all indexes
CLOSE [Cursor_Indexes]
DEALLOCATE [Cursor_Indexes]
End -- Ends looping through all tables
CLOSE Cursor_Tables
DEALLOCATE Cursor_Tables
foreach (objDB DB in oUserPrefs.DBs) {
report += DB.Real_Name;
if (DB.cn == null) DB.cn = sqlCn(DB.Real_Name, SystemInformation.ComputerName);
try {
if (DB.cn.State != ConnectionState.Open) DB.cn.Open();
} catch (Exception ex) {
report += " - Failed because can't open a connection.\r\n";
continue;
DB.OpenedAConnection = true;
DataTable dt = null;
try {
dt = oParam.fillDt("dbo.usp_RebuildIndexes", DB.cn, null);
} catch (Exception ex) {
report += " -failed because " + ex.Message + "\r\n\r\n";
continue;
report += " - success.\r\n";
DB.LastTimeRebuiltIndexes = DateTime.Now;

Your proc is a bit of a mess and hard to read. This should get you what you need though. I added a little logic in the middle that determines if the index should be reorged, or rebuilt.
You were right that my script was too messy and I used your code/logic to rewrite mine. Thanks! I tried it this morning and it worked fine, but I will have to see how it runs overnight to be sure.
Here's the weird thing. My original code should have worked. In fact I'm actually using it in 3 c-sharp apps each of which has 3 to 7  Express 2012 databases (about 10 million records per database). For about a month it's been working fine on two of the
apps. Furthermore this morning I used a commercial file-comparison tool to verify that the 3rd app has been running an identical version of the SP. So I'm at a total loss as to what went wrong in the 3rd app.
Here's my rewrite.
Alter Procedure [dbo].[usp_RebuildIndexes]
As
Declare @Messages Table(Msg nvarchar(2000))
Declare @IndexName nvarchar(256), @TableName NVARCHAR(256)
DECLARE Cursor_Indexes CURSOR FAST_FORWARD FOR -- GEt a list of all indexes for all tables.
select idxs.name as indexName, o.Name as TableName
from sys.indexes idxs
inner join sysobjects o on idxs.object_id = o.id
inner join sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL,NULL,NULL) as stats
on stats.object_id = idxs.object_id and stats.index_id = idxs.index_id
where xtype = 'u' and idxs.name is not null And avg_fragmentation_in_percent > 7
OPEN Cursor_Indexes
While 1 = 1
BEGIN
FETCH NEXT FROM Cursor_Indexes INTO @IndexName, @TableName
if @@FETCH_STATUS <> 0 break
Declare @SqL nvarchar(2000) = N'ALTER INDEX ' + @IndexName + ' ON ' + DB_Name() + '.dbo.' + @TableName + ' Rebuild'
insert @Messages(Msg)VALUES(@sql)
Execute sp_executeSQL @sql
End
CLOSE [Cursor_Indexes]
DEALLOCATE [Cursor_Indexes]
Select * From @Messages

Similar Messages

  • Procedure runs in SQL Plus, but not when called from my Oracle Form

    Hi. I have this code to send an email alert as the user updates a record on my base table from my Oracle Form. I use dbms_scheduler so that it's submitted as a background job and so the email processing does not delay my Oracle Form from saving quickly. If I submit this code in SQL Plus it executes and I receive the email as expected.
    begin
    dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (62547, ''01-SEP-11'', ''02-SEP-11''); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;However if I submit this code from a Post-Update trigger in my form the code runs without error, but my email is never received (the same parameter values would be passed to this trigger):
    begin
    -- Submit the email notification in the background so as to not slow down the screen while saving.   
    dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationConflict_Notify (:dropper_vacations.dropper_id, :dropper_vacations.begin_dt, :dropper_vacations.end_dt); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;     Any ideas why this might be happening?

    Wow, so I changed the two procedures so that I'm only passing in one number parameter and one char parameter...
    CREATE OR REPLACE procedure TTMS.job_vacationconflict_notify (p_dropper_id number, p_other char) IS
    CREATE OR REPLACE PROCEDURE TTMS.dropperVacationEmailURL_new (in_dropper_id number, in_other char) ISIf I execute it like this it works and I get the email:
    TTMS.job_vacationconflict_notify(62547, 99999);or like this it works and I get the email:
    TTMS.job_vacationconflict_notify(62547, '99999');But if I execute it like this (I get no errors) the email is not sent:
    TTMS.job_vacationconflict_notify(62547, 'ababa');So this problem really has nothing to do with date formats. It seems to have to do with whether parameter two has characters in it!!! What the heck.
    Any ideas on this?
    Here is the procedure I'm calling:
    CREATE OR REPLACE procedure TTMS.job_vacationconflict_notify (p_dropper_id number, p_other char) IS
    begin
      dbms_scheduler.create_job ( 
         job_name            => 'IMMEDIATE_JOB', 
         job_type            => 'PLSQL_BLOCK', 
         job_action          => 'begin TTMS.dropperVacationemailurl_new ('||p_dropper_id||','||p_other||'); end;', 
         number_of_arguments => 0, 
         start_date          => sysdate +1/24/59, -- sysdate + 1 minute 
         enabled             => TRUE, 
         auto_drop           => TRUE, 
         comments            => 'Immediate, one-time run');
    end;
    /And the above procedure is calling this procedure which should be sending the email alert:
    CREATE OR REPLACE PROCEDURE TTMS.dropperVacationEmailURL_new (in_dropper_id number, in_other char) IS
          myguid varchar2(15):=null;
          pcm_contact varchar2(3):=null;
          guid_contact varchar2(15):=null;
          conflict_cnt number(8):=0;
          -- Various declarations
          PSENDER VARCHAR2(200);            --  From
          PRECIPIENT VARCHAR2(200);         --  To
          P_CC_RECIPIENT VARCHAR2(200);     --  CC
          P_BCC_RECIPIENT VARCHAR2(200);    --  BCC
          PSUBJECT VARCHAR2(200);           --  Subject
          PMESSAGE VARCHAR2(6000);          --  Message Body
          PPARAMETER NUMBER;                --  Parameter Value
          guid_valid varchar2(15);          --  Used to grab the validation value of
          -- Grab name details of e-mail targets
          cursor targets is
          select guid, initcap(first_name) first_name, initcap(first_name)||' '||initcap(last_name) fullname
          from pwc_employee
          where upper(guid) = upper(guid_contact);
    BEGIN
            select count(*)
            into conflict_cnt
            from dropper_bundle_assign
            where
                dropper_sched = in_dropper_id and
                trunc(sched) <> '31-DEC-29' AND        
                trunc(sched) between '01-SEP-11' and '02-SEP-11' and
                trunc(sched) > trunc(sysdate);
            select distinct pcm
            into pcm_contact
            from dropper_bundle_assign
            where
                  dropper_sched = in_dropper_id and
                  trunc(sched) <> '31-DEC-29' AND        
                  trunc(sched) between '01-SEP-11' and '02-SEP-11' and
                  trunc(sched) > trunc(sysdate);
            select guid
            into guid_contact
            from pwc_employee
            where initials = pcm_contact;
        -- Ensure required parameters have been passed
        if guid_contact is not null
           and in_dropper_id is not null then
               Begin
                    select guid
                    into guid_valid
                    from pwc_employee
                    where upper(guid) = upper(guid_contact);
               Exception
                    when no_data_found then
                    raise_application_error(-20000,'Invalid Recipient.  Please check the employee table.  Please try again.');
               End;
               -- In the event there are multiple targets then we will loop thru and send individual emails
               for thisone in targets loop
                    PSENDER := lower(user)||'@us.ibm.com';
                    PRECIPIENT := lower(thisone.guid)||'@us.ibm.com';
                    P_CC_RECIPIENT := lower(thisone.guid)||'@us.ibm.com';
                    P_BCC_RECIPIENT := 'ssbuechl'||'@us.ibm.com';
                    PPARAMETER := TO_NUMBER(lower(in_dropper_id));
                    PSUBJECT := 'TEST: Dropper Vacation '||in_other||' Conflict Notification for dropper '||in_dropper_id||' - Action Required';
                    PMESSAGE := thisone.first_name||'-<br><br>There is an induction conflict due to a new or updated dropper vacation.<br><br>Click here to the dropper''s vacation conflicts: <u><a href="http://9.35.32.205:7777/forms/frmservlet?config=TTMSMENU&form=dropper_vacations&otherparams=p_dropper='||PPARAMETER||'">Dropper Id: '||PPARAMETER||'</a></u> (note: use your Oracle credentials when prompted for log-on information).<br><br>Thanks.';
                    SEND_MAIL ( PSENDER, PRECIPIENT, P_CC_RECIPIENT, P_BCC_RECIPIENT, PSUBJECT, PMESSAGE );  -- Procedure to physically send the e-mail notification
               end loop;
        else
              raise_application_error(-20001,'Recipient and Parameter Value are required. Please try again.');
        end if;
    exception
        when no_data_found then
             raise_application_error(-20002,'Note: Email will not be sent because no PCM was identified as the manager or the PCM does not have a record in the Employee table.  See ITS for assistance.');
         when too_many_rows then
             raise_application_error(-20003,'Note: Email will not be sent because multiple PCMs manage this dropper. Please notify each PCM manually.');
    END dropperVacationEmailURL_new;
    /Edited by: sharpe on Aug 17, 2011 4:38 PM
    Edited by: sharpe on Aug 17, 2011 5:03 PM

  • HT5361 Mail runs fine at first but after awhile it freezes the machine.  I have shut the mac down and restart. I am running Mountain Lion.

    Mail runs fine at first but after awhile it freezes the machine.  I have shut the mac down and restart. I am running Mountain Lion which was updated from Leopard.  I reinstalled original programs from disk and solved this same problem with Contact.  Mail is still a problem.  May also include itunes which seems to add to the problem.

    Run Disk Utility to check the SMART status of your hard drive.

  • I have updated iOS 6 in my iPhone 4S and it went perfectly fine. Just after that when I opened the message app I found that the sms body of system generated messages was not visible after tapping on them.

    I have updated iOS 6 in my iPhone 4S and it went perfectly fine. Just after that when I opened the message app I found that the sms body of system generated messages was not visible after tapping on them.

    The terms of service of the Apple Support Communities prevent us from helping anyone with a jailbroken phone.
    You're on your own.  Good luck.

  • Unit test runs perfectly fine with NUnit but fails when run from TestExplorer

    Hello all,
    I have a TestProject, Harmony.Tests. In there, I have a method AddApplicationEvent()
    which calls another method Send(InvokeRequestMessage requestMessage) which calls a webservice (OperationHandlerBrokerWebService). 
    The code snippet looks like this. This is not the complete code but a part where we are calling the web service. It fails on the underlined Italic line of code.
    OperationHandlerBrokerWebService brokerService = new OperationHandlerBrokerWebService();
    brokerService.UseDefaultCredentials = true;
    brokerService.Url = address;
    brokerService.Timeout = timeoutInMilliseconds;
    byte[] serializedResponseMessage = brokerService.InvokeOperationHandler(serializedRequestMessage);
    The same test works and passed fine when I ran it with NUnit, but failed with following exception when I tried to run it from TestExplorer. 
    Test Name: AddApplicationEvent
    Test FullName: N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.AddApplicationEvent
    Test Source: d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs : line 665
    Test Outcome: Failed
    Test Duration: 0:00:00.296
    Result Message:
    SetUp : Message returned System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Invalid token for impersonation - it cannot be duplicated.
    at System.Security.Principal.WindowsIdentity.CreateFromToken(IntPtr userToken)
    at System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info)
    at System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info, StreamingContext context)
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
    at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
    at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
    at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
    at System.Runtime.Serialization.ObjectManager.DoFixups()
    at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
    at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
    at N4S.Forms.OperationHandlerBroker.AMessage.DeserializeMessage(Byte[] serializedMessage)
    at N4S.Forms.OperationHandlerBroker.WebServiceServer.BrokerService.InvokeOperationHandler(Byte[] serializedInvokeRequestMessage)
    --- End of inner exception stack trace ---
    expected: <0>
    but was: <1>
    Result StackTrace:
    at N4S.Harmony.Tests.TestHelper.InvokeOperation(OperationHandler handler, OperationHandlerInput input, Boolean expectedToWork) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 136
    at N4S.Harmony.Tests.TestHelper.LoginAsUser(String username, String password) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 394
    at N4S.Harmony.Tests.TestHelper.Login(TestUserName requestedUser) in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 377
    at N4S.Harmony.Tests.TestHelper.LoginAsAdvisor() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\TestHelper.cs:line 230
    at N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.Login() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs:line 76
    at N4S.Harmony.Tests.CaseManagement.HarmonyFacadeTests.SetupTest() in d:\TFS\TMW\Dev\TMWOnline\Harmony\N4S.Harmony.Tests\CaseManagement\HarmonyFacadeTests.cs:line 67
    I am not sure what causing the issue. I checked the Credentials, Windows Identity during both the test run and there is no difference. Please advise !!
    Thanks,
    Deepak

    Hi Tina,
    Thanks for your reply. 
    I do have NUnit adapter installed. I even noticed that the test runs fine with NUnit GUI and also if I run it through Resharper Test Explorer window. 
    As you can see in the image above the same test is passed when I ran it from Resharper Unit Test Explorer window but fails when I ran it from Test Explorer window. I also captured the information on fiddler. 
    There was a significant difference in the Header Content length. Also under the User-Agent property the protocol versions are different. 
    Not sure why VSTest ExecutionEngine is picking a different version.
    The UnitTest in question is calling a webservice method which in turn calls a method from another referenced project. 
    Web Service class
    using System;
    using System.Web.Services;
    using N4S.Forms.OperationHandlerBroker.Server;
    using NLog;
    namespace N4S.Forms.OperationHandlerBroker.WebServiceServer
    /// <summary>
    /// The operaton-handler broker service.
    /// </summary>
    [WebService(Description = "The N4S Forms Operation-Handler Broker Web-Service.", Name = "OperationHandlerBrokerWebService",
    Namespace = "N4S.Forms.OperationHandlerBroker.WebServiceServer")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class BrokerService : WebService
    { /// <summary>
    /// Calls <see cref="HandleRequest"/>. Updates performance-counters.
    /// </summary>
    /// <param name="serializedInvokeRequestMessage">the binary-serialized <see cref="InvokeRequestMessage"/></param>
    /// <returns>the binary-serialized response message</returns>
    [WebMethod(BufferResponse = true, CacheDuration = 0, Description = "Invokes the requested operation-handler and returns a binary-serialized response-message.", EnableSession = false)]
    public byte[] InvokeOperationHandler(byte[] serializedInvokeRequestMessage)
    logger.Trace(Strings.TraceMethodEntered);
    PerformanceMonitor.RecordRequestStarted();
    InvokeRequestMessage requestMessage = (InvokeRequestMessage) AMessage.DeserializeMessage(serializedInvokeRequestMessage);
    InvokeResponseMessage responseMessage;
    try
    responseMessage = HandleRequest(requestMessage);
    PerformanceMonitor.RecordSuccessfulRequest();
    catch (Exception)
    PerformanceMonitor.RecordFailedRequest();
    throw;
    finally
    PerformanceMonitor.RecordRequestEnded();
    logger.Trace(Strings.TraceMethodExiting);
    return AMessage.SerializeMessage(responseMessage);
    UnitTest snippet
    OperationHandlerBrokerWebService brokerService = new OperationHandlerBrokerWebService();
    brokerService.UseDefaultCredentials = true;
    byte[] serializedResponseMessage = brokerService.InvokeOperationHandler(serializedRequestMessage);
    Please advise.
    Thanks,
    Deepak

  • Crystal Reports 2008 fails when called from e Web Service under 64bit OS

    I have discovered that Crystal Reports 2008 doesn't work when called from a Web Service running under 64bit Windows platforms (in my case Windows 2003 Server and Windows XP 64bit); practically no object is instantiated. I've tried several solutions without success.
    Before creating a wrapper component to use under COM+, is there anybody who has a better and cheaper solution than creating another component to wrap CR 2008 ?

    Hi Sergio,
    Before I mark this post as assumed answered I would just like to say and re-iterate that at this time there is no one answer and we fully understand your concerns. As you know in CR 6.0 it came in 16 and 32 bit versions because at the time 32 bit was relatively new but 16 bit was the norm. This is also true for 32 to 64 bit, 32 is the norm and 64 bit is relatively new. We know and are well aware 64 bit is the future and we are working as quickly as we can to move in that direction. Because of the complexity of the Product it's not simply a matter of re-compiling all of our dll's in 64 bit format. The core of our data connectivity with our database drivers which are dependant on third party clients must also need to support 64 bit modes. This as well as Printer drivers also need to be 64 compatable, there are a multitude of dependencies that we rely on that must add 64 bit support. As a programmer you are well aware of the issues around Thunking back and forth between 32 to 64 bits, it can cause delays and potentially loss of data which is a whole other issue. Not to mention also that we would have to ship both versions potentially doubling the size of the distribution packages or doubling the size of the dll's to have the ability to work in both modes. Relatively speaking of course, it would not be double the size but the variables would need to be able to allocate 32 or 64 memory blocks.
    The other option is to produce 2 separate versions, this alone is a massive project. Any issue would need to be fixed in separate code streams.
    So I'm sure you can see it's not simply a matter of saying yes we support 64 bit. It's a massive project that is going to take time to do and we have to wait for the third party drivers to commit also.
    Visual Studio .NET 2005 and 2008 is the only option if you want true 64 bit but you will be limited on what DB's you can support and export formats you can export to. They are the only drivers we did convert to 64 bit.
    Thank you for your understanding
    Don

  • Stored procedure runs OK from SSMS but fails from job scheduler

    I have a stored procedure that queries the sysmanagement_shared_registered_servers_internal table in MSDB and performs various other queries from the servers listed in that table via linked servers.  I have created a login called SQLInfo_user. When
    I run the stored procedure from SSMS with the connection as SQLInfo_user, everything works as designed. However, when I run the job from the job scheduler with SQLInfo_user as the "run as user" parameter, it fails with "Executed as user: SQLInfo_user.
    The SELECT permission was denied on the object 'sysmanagement_shared_registered_servers_internal', database 'msdb', schema 'dbo'. [SQLSTATE 42000] (Error 229).  The step failed."  The login SQLInfo_user has full read and select permissions to
    that table in the MSDB database.  Any suggestions?  Thanks

    Try instead of  "run as user", make that user owner of job. Also, make sure your that user is in linked server for servers that you are connecting has equivalent user on the the destination servers. 
    Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.

  • App runs fine in simulator but fails on iPad

    My app has been running fine in the simulator environment but tried running for the first time on an iPad.  It loads the first screen (which is a table view) but if I try to do anything, including just scrolling the table, it crashes.  The Xcode organiser shows the following:
    >
    Aug 11 17:24:29 unknown UserEventAgent[12] <Notice>: jetsam: kernel termination snapshot being created
    Aug 11 17:24:29 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilephone[0xd6d9]) Exited: Killed: 9
    Aug 11 17:24:29 unknown SpringBoard[15] <Warning>: Application 'FaceTime' exited abnormally with signal 9: Killed: 9
    Aug 11 17:24:29 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.andion.TKD[0x6992]) Exited: Killed: 9
    Aug 11 17:24:29 unknown ReportCrash[1286] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2012-08-11-172429.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
    Aug 11 17:24:29 unknown SpringBoard[15] <Warning>: Application 'TKD' exited abnormally with signal 9: Killed: 9
    > >
    If I look in the crash logs in organiser all I can see is one from Safari dated weeks ago.  How do I find the log referred to in the message above?
    The app (TKD) is 16MB and the iPad reports 26GB available, so although there appears to be a reference to LowMemory, surely that isn't actually the problem?   Am I doing something which is impacting FaceTime and why is there a message about com.apple.mobilephone on an iPad?  Am I doing something horribly wrong?
    Any help much appreciated!

    'killed' typically means the app was unresponsive just long enough for the OS to take action.
    You should be able to see something in Xcode's console during debugging on the device.
    Ken

  • Insert using Spatial Index fails when called from PHP

    I have a stored procedure that inserts into a table with a spatial index on one of its fields.
    When I run the procedure from SQL Server Management Studio it runs just fine.
    When I run it from PHP, it returns the error: "INSERT failed because the following SET options have incorrect settings: 'CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes
    on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations"
    From within Management Studio, I have tried many different combinations of settings, until I wound up with the list I have in the procedure below.
    Within Managment Studio the error changes based on the options I have set, but PHP always replies with: 'CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'
    I have configured PHP to use the same SQL user as management studio, and I have tried both mssql_query and mssql_execute with bound parameters.
    The spatial index is on the field post.location If I remove the spatial index it works, but I need the spatial index.
    CREATE PROCEDURE insert_post ( @subject AS VARCHAR(250), @body AS VARCHAR(2000), @latitude AS FLOAT, @longitude AS FLOAT ) AS BEGIN
    SET NOCOUNT ON
    SET ANSI_WARNINGS ON
    SET ANSI_PADDING ON
    SET CONCAT_NULL_YIELDS_NULL ON
    SET NUMERIC_ROUNDABORT OFF
    DECLARE @location AS geography = geography::Point(@latitude, @longitude, 4326)
    INSERT INTO post
        subject,
        body,
        location
    ) VALUES (
        @subject,
        @body,
        @location
    END

    Hi Charles
    Your issue looks like it have two basic sources: (1) The connection string properties, (2) The table structure and the data which you try to insert.
    (1) The connection string properties can be specified in various ways.
    You can set most of them during the connection, depending on the provider which you are using. We did not get from you any information about the PHP code, so we have no information regarding this part.
    The connection properties can be changed after the connection was made, which is basically what you have try to do. But we don't know what properties
    are differents (since you .. the PHP code..) but you can check those properties dynamically, insert them to a table and then compare. To check all the properties you can use this post:
    http://ariely.info/Blog/tabid/83/EntryId/153/SQL-Server-Get-Connection-Properties.aspx
    (2) We need to understand your
    table structure and compare it to yours query. Please post your DDL+DML (queries to create the table and to insert some sample data), and the full SP code
    as it is now.
    [Personal Site]  [Blog]  [Facebook]

  • Java class files works on middle tier but chokes when called from pl/sql

    Hi,
    I have 2 class files WorkOrder and xxWorkOrder. xxWorkOrder creates an instance of WorkOrder. Both classes are under the /classes directory. Both compile fine and I have used loadjava to upload/resolve both in the database. I can see them as valid under the user_objects table. I created a function using Pl/sql which calls a method in xxWorkOrder. If I remove the line in xxWorkOrder where it creates an instance of WorkOrder, the pl/sql function works fine via sql plus. If I add the line in, it gives me ORA-29532: Java call terminated by uncaught Java exception: java.lang.ExceptionInInitializerError if i run my test again I get a No classdef found error.
    If i run the xxWorkOrder class file directly from the server using java, the code works fine with the instantiation of WorkOrder within it.
    I'm not sure which step I am missing ? For some reason when the pl/sql function calls the java method in xxWorkOrder and it sees the line where the instance of WorkOrder is created, it chokes.
    Please help!
    Preeti

    ExceptionInInitializerError means that whatever is being done at the time it occurs is trying to use some class for the first time so that an attempt to initialize that class is occurring and failing. Such a failure typically means that there is code in a static initializer, such as the foo(); in
    static SomeType someVarName = foo();
    or just any thing within
    static { ... }
    in the class being initialized which signals an uncaught exception. It's impossible to say why this would be happening in your particular case without seeing the code. Depending on the release you are using there may be more information (such as a backtrace of the original error) in the .trc file. An example of what I am describing in your case would be if the constructor for WorkOrder invoked a method on some class N, where N hadn't previously been used and where N contained
    static Class loser = Class.forName('no/such/Class');
    In this (admittedly goofy) case you might expect to see in the .trc file a backtrace for the ExceptionInInitializer error with a sub backtrace identified with "Caused by" that starts with a NoClassDefFound exception or the like. This might work outside the server if "no/such/Class" was present there but had not been loaded into the database.

  • Journal import fails when called from PLSQL

    Hi,
    When journal import is called from plsql code it is failing with error in 'gllacc() Function returning without value and no data found'.
    Same transaction is run succesfully from front end.
    I checked both gl_interface and gl_interface_control table but couldnt find the issue.
    Any info on this would be very helpful.
    Thanks
    Sandhya

    FOR l_rec IN (SELECT ledger_id,group_id from apps.gl_interface
    WHERE status='NEW'
    AND user_je_source_name='GIS_DATA_CONVERSION'
    GROUP BY ledger_id,group_id
    ORDER BY group_id
    LOOP
    apps.gl_journal_import_pkg.populate_interface_control (user_je_source_name => 'GIS_DATA_CONVERSION',
    GROUP_ID => l_rec.group_id,
    set_of_books_id => l_rec.ledger_id,
    interface_run_id =>vl_interface_id,
    table_name => 'GL_INTERFACE',
    processed_data_action=>'D'
    COMMIT;
    vl_request_id := apps.fnd_request.submit_request (application => 'SQLGL', -- application short name
    program => 'GLLEZLSRS', -- program short name
    description => NULL, -- program name
    start_time => NULL, -- start date
    sub_request => FALSE, -- sub-request
    argument1 => 2065, --Data access set id
    argument2 => 'GIS_DATA_CONVERSION', --Source
    argument3 => l_rec.ledger_id, -- set of books id
    argument4 => l_rec.group_id,
    argument5 => 'N', -- error to suspense flag
    argument6 => NULL, -- create summary flag
    argument7 => 'N' -- import desc flex flag
    COMMIT;
    IF ( vl_request_id = 0 ) THEN
    xxgis.gis_conv_util_pkg.debug_print_p(1,'FND_LOG','E001: Journal Import Submission Failed. ' || SQLERRM);
    retcode := 2;
    EXIT;
    ELSE
    xxgis.gis_conv_util_pkg.debug_print_p(1,'FND_LOG','P001: Submitted Journal Import Program for group id: ' || l_rec.group_id ||
    'and ledger :'||l_rec.ledger_id|| ', Request ID: ' || vl_request_id);
    END IF;
    END LOOP;

  • LocateRegistry.getRegistry() fails when called from Tomcat 5.5 servlet

    I'm trying to access a simple RMI server from a Tomcat 5.5 (Java 5) servlet. I get access exceptions having to do with java.util.logging.LoggingPermission. (The RMI server works fine with a simple command line Java app.)
    Is there some reason that calling getRegistry() from within a servlet should fail? Is there some reason that it should require LoggingPermission?
    I've modified the catalina.policy file to grant all permission to everything but I still get the same errors.
    Surely there is a way to make RMI calls from a servlet. Any suggestions on how to fix this? Thanks.

    show us the script

  • Mapedit fails when called from Visio, but works in Project

    Hi - 
    I'm writing some vba code in Visio that 1. opens a selected Project file, 2. creates a Map, and 3. exports that map data to Excel. I've got the rest of the code working, but I get an error 1101 / argument value is not valid with this statement.
    The MS Project code that works when run in Project is this: 
                Application.MapEdit name:="visio_HLS_export", Create:=True, OverwriteExisting:=True, _
                DataCategory:=pjMapTasks, CategoryEnabled:=True, TableName:="tasks", _
                FieldName:="Unique ID", ExternalFieldName:="TaskUID", ExportFilter:="IsMilestoneFlag"
    The code in Visio is the same, except the "Application" object is replaced with my MSProject object (mspApp). I've got a similar routine set up to create the "IsMilestoneFlag" filter, and that is working fine. The filter is created in
    the local organizer, then copied to Global.mpt, so it should be able to find it. Not sure what else could be causing the failure. 
    Set mspApp = CreateObject("MSProject.Application") 
            mspApp.MapEdit Name:="visio_HLS_export", Create:=True, OverwriteExisting:=True, _
            DataCategory:=pjMapTasks, CategoryEnabled:=True, TableName:="tasks", _
            FieldName:="Unique ID", ExternalFieldName:="TaskUID", ExportFilter:="IsMilestoneFlag"
    Any ideas? 

    matttjo,
    This might be s shot in the dark, but looking at the MapEdit Method, the only argument that is suspect when controlling Project from another app is the DataCategory argument. All other arguments are either string, or boolean. You might try adding a reference
    to the DataCategory, something like:
    DataCategory:=mspApp.pjMapTask
    Since all arguments of the method are optional, you could try eliminating one at a time (or adding one at a time) and see which one causes the problem.
    Hope this helps.
    John

  • CUPS print job options fail when called from lp (UNIX command line)

    Under Leopard this command-line print request fails to respect the specified job options:
    lp -o number-up=2 -o page-border=double <filename>
    Though it worked great in Tiger, the number-up and page-border job options are now disregarded. I have tried lots of things (and wasted lots of paper) such as setting them permanently with lpoptions (and they do appear changed when the lpoptions command is repeated), using lpr instead of lp, reinstalling the printer via the CUPS localhost web interface, enabling non-Bonjour scanning with the hack to the CUPS preference file, deselecting "Last Printer Used" for the default printer in the System Preferences -- nope.
    I have not tried other job options; I assume that whatever is breaking these two is breaking all the others, and even if it isn't, these two are what I want.
    Is something new in Leopard overriding lpoptions job options? How do I make it stop? It is sooooo aggravating when something that used to work fine breaks. The printer is an HP LaserJet 4000N connected by Ethernet and discovered with AppleTalk.
    Thanks for any advice!

    Thanks John, I did search but somehow missed that thread.
    However it did not help. With or without the "-p printername" argument lpoptions does make a persistent change to its own data:
    +$ lpoptions+
    +media=Letter sides=one-sided finishings=3 copies=1 job-hold-until=no-hold job-priority=50 number-up=2 auth-info-required=none job-sheets=none,none printer-info=Barrow printer-is-accepting-jobs=1 printer-is-shared=0 printer-location='Local Zone' printer-make-and-model='HP LaserJet 4000 Series' printer-state=3 printer-state-change-time=1209495301 printer-state-reasons=none printer-type=2134228 page-border=double+
    You can see that the printer "Barrow" has remembered "number-up=2" and "page-border=double". Regardless if I give any of these commands:
    +lpr <filename>+
    +lpr -P Barrow <filename>+
    +lp <filename>+
    +lp -d Barrow <filename>+
    none of them show the results of these option settings (and somewhere in the forest another tree is cut down).

  • Using Wireless printer 4500 series and prints dark from laptop but light when sent from a phone?

    I am using a wireless  f4580 printer i believe and when I print from my laptop the item print dark but when I send items from my Iphone 4 to the print they print so light you can barely see them and I just replaced the ink so I know it isn't that. What am doing wrong or what do I need to do? thanks in advance.

    Do you see any advanced options for managing print quality,  like "Economode printing" or changing print speed (draft, normal, best etc.) while printing from Iphone4?  If yes,  then choose options to give best print output.
    If there are no options available while printing document, then you might need to see if you have same document or same document properties & contents (font - size, color, etc.) while printing from different computers.
    Please mark the post that solves your problem as Accepted Solution
    Click the 'Kudos Thumbs Up' if this was helpful. Thank You!
    (Although I am an HP employee, I am speaking for myself and not for HP)

Maybe you are looking for

  • How to enter letter of credit and bank draft

    hi, 1) if i would like to enter letter of credit and bank draft in system, what tcode to do so? 2) it is statistical or noted? 3) LC can be from customer and vendor? 4) bank draft only for customer, right? thanks

  • Opening PDF in CS6 - Mountain Lion

    Hi all, I am running CS6 on my MAC Pro OS Mountain Lion. When trying to open a multi page PDF in illustrator I often do not get the page selection pop up and it automatically opens the first page of the PDF in illustrator. It is very hit and miss whi

  • How to change both start and end dates for an business event (or any object

    Hi all. We are in the case to change the validity dates for several business events in training management. The special point is that both, start and end date, have to be changed. In example, business event 00000001 is valid from 2010.01.01 to 2010.0

  • Playing Quicktime movies in Firefox

    Whenever I reach a webpage, example football365.com that has embedded video, Quicktime plays the video as a separate window rather than within the webpage. I use Firefox 2.0.0.15 and Quicktime Player 7.5.0 on Mac OS 10.5.4. Any ideas how to solve thi

  • How to stop a app that is not responding. It is always loading

    How to stop and delete an app that is no longer responding. It is always loading