Search Results

Search found 19499 results on 780 pages for 'transaction log'.

Page 13/780 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • need example sql transaction procedures for sales tracking or financial database [closed]

    - by fa1c0n3r
    hi, i am making a database for an accounting/sales type system similar to a car sales database and would like to make some transactions for the following real world actions salesman creates new product shipped onto floor (itempk, car make, year, price).   salesman changes price.   salesman creates sale entry for product sold (salespk, itemforeignkey, price sold, salesman).   salesman cancels item for removed product.   salesman cancels sale for cancelled sale    the examples i have found online are too generic...like this is a transaction... i would like something resembling what i am trying to do to understand it.  anybody have some good similar or related sql examples i can look at to design these? do people use transactions for sales databases?  or if you have done this kind of sql transaction before could you make an outline for how these could be made?  thanks  my thread so far on stack overflow... http://stackoverflow.com/q/4975484/613799

    Read the article

  • SQL Server Transaction Log Fragmentation: a Primer

    Generally, you will have no need to worry about the number of virtual log files in your transaction log. However, if you use the default settings for 'auto-grow', you can end up with such 'fragmentation' in your transaction log as to affect performance noticably. How can this be avoided? How can you tell it's a problem? What do you do about it? Greg explains. "SQL Backup Pro 7 improves on an already wonderful product" - Don KolendaHave you tried version 7 yet? Get faster, smaller, fully verified backups. Download a free trial of SQL Backup Pro 7.

    Read the article

  • How to Truncate the Log File

    - by Derek Dieter
    Sometimes after one or more large transactions, the t-log (transaction log) will become full. In these particular cases you may receive an error message indicating the transaction log is full. In order to alleviate this issue, you need to find the names of the transaction logs on your system and then shrink them. To find the [...]

    Read the article

  • Using INSERT / OUTPUT in a SQL Server Transaction

    Frequently I find myself in situations where I need to insert records into a table in a set-based operation wrapped inside of a transaction where secondarily, and within the same transaction, I spawn-off subsequent inserts into related tables where I need to pass-in key values that were the outcome of the initial INSERT command. Thanks to a Transact/SQL enhancement in SQL Server, this just became much easier and can be done in a single statement... WITHOUT A TRIGGER! Join SQL Backup’s 35,000+ customers to compress and strengthen your backups "SQL Backup will be a REAL boost to any DBA lucky enough to use it." Jonathan Allen. Download a free trial now.

    Read the article

  • SQL Server 2008 log issue

    - by George2
    Hello everyone, I am using SQL Server 2008 Enterprise. Under logs folder, in my machine it is C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log, there are three kinds of files, ERRORLOG, ERRORLOG.1, ERRORLOG.2 ... ERRORLOG.6; FDLAUNCHERRORLOG, FDLAUNCHERRORLOG.1, FDLAUNCHERRORLOG.2, ... FDLAUNCHERRORLOG.6; log_207.trc, log_208.trc, ... My question is what are the differnet function of such log files? And why there are files ends with .1, .2, etc? thanks in advance, George

    Read the article

  • hundreds of databases sql server log shipping

    - by Oliver
    SQL Server 2005 Standard 64x, with 300+ tiny databases currently (5MB each), user base adds databases as needed. Want to implement log shipping for warm standby, but not via the wizard, since that looks like it adds 3 jobs (1 on primary, 2 on secondary) for each log-shipped database. Do I try to write my own or use something like Quest's LiteSpeed? Or am I being too squeamish about having hundreds of SQL Server Agent jobs and all of them firing off (or worse, would I have to try to time them)? All advice welcome.

    Read the article

  • log4net: log information into different log files

    - by Daoming Yang
    I have the following configurations in my web.config file, but how can I log the information into data.txt and general.txt separately in C#? Could anyone provide some sample code for me? <appender name="GeneralLog" type="log4net.Appender.RollingFileAppender"> <file value="App_Data/Logs/general.txt" /> <appendToFile value="true" /> <maximumFileSize value="2MB" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="5" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n" /> </layout> </appender> <appender name="DataLog" type="log4net.Appender.RollingFileAppender"> <file value="App_Data/Logs/data.txt" /> <appendToFile value="true" /> <maximumFileSize value="2MB" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="5" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n" /> </layout> </appender>

    Read the article

  • Which is best Postfix Log analyzer?

    - by Anto Binish Kaspar
    Which is best Postfix Log analyzer? We are looking for good log analyzer for postfix. We need to analyze the following How many mails queued ? How many mails not delivered ? Why mails are not delivered ? And is it possible to view the subject for the all mail status instead of message id? I mean to review the status of the single mail. We are using Sawmill analyzer now. But the management is not satisfied with the report from the sawmaill, since its missing single message status and subject.

    Read the article

  • How To see keyboard log of 3 computer from another computer?

    - by NT
    Hello, I have a small office with 3 computers + my own laptop without any network between these computers. I would like to see keyboard log of each worker computer from my laptop without disturbing my workers. I should be able to see each keyboard log from my laptop (from GUI or e-mail message) Also, is it possible to limit the logging? For example I would not to see log of msn messenger, but I should see log of IE,Outlook etc...?

    Read the article

  • EJB3 Transaction Propogation

    - by Matt S.
    I have a stateless bean something like: @Stateless public class MyStatelessBean implements MyStatelessLocal, MyStatelessRemote { @PersistenceContext(unitName="myPC") private EntityManager mgr; @TransationAttribute(TransactionAttributeType.SUPPORTED) public void processObjects(List<Object> objs) { // this method just processes the data; no need for a transaction for(Object obj : objs) { this.process(obj); } } @TransationAttribute(TransactionAttributeType.REQUIRES_NEW) public void process(Object obj) { // do some work with obj that must be in the scope of a transaction this.mgr.merge(obj); // ... this.mgr.merge(obj); // ... this.mgr.flush(); } } The typically usage then is the client would call processObjects(...), which doesn't actually interact with the entity manager. It does what it needs to do and calls process(...) individually for each object to process. The duration of process(...) is relatively short, but processObjects(...) could take a very long time to run through everything. Therefore I don't want it to maintain an open transaction. I do need the individual process(...) operations to operate within their own transaction. This should be a new transaction for every call. Lastly I'd like to keep the option open for the client to call process(...) directly. I've tried a number of different transaction types: never, not supported, supported (on processObjects) and required, requires new (on process) but I get TransactionRequiredException every time merge() is called. I've been able to make it work by splitting up the methods into two different beans: @Stateless @TransationAttribute(TransactionAttributeType.NOT_SUPPORTED) public class MyStatelessBean1 implements MyStatelessLocal1, MyStatelessRemote1 { @EJB private MyStatelessBean2 myBean2; public void processObjects(List<Object> objs) { // this method just processes the data; no need for a transaction for(Object obj : objs) { this.myBean2.process(obj); } } } @Stateless public class MyStatelessBean2 implements MyStatelessLocal2, MyStatelessRemote2 { @PersistenceContext(unitName="myPC") private EntityManager mgr; @TransationAttribute(TransactionAttributeType.REQUIRES_NEW) public void process(Object obj) { // do some work with obj that must be in the scope of a transaction this.mgr.merge(obj); // ... this.mgr.merge(obj); // ... this.mgr.flush(); } } but I'm still curious if it's possible to accomplish this in one class. It looks to me like the transaction manager only operates at the bean level, even when individual methods are given more specific annotations. So if I mark one method in a way to prevent the transaction from starting calling other methods within that same instance will also not create a transaction, no matter how they're marked? I'm using JBoss Application Server 4.2.1.GA, but non-specific answers are welcome / preferred.

    Read the article

  • Hibernate save() and transaction rollback

    - by Marco
    Hi, In Hibernate when i save() an object in a transaction, and then i rollback it, the saved object still remains in the DB. It's strange because this issue doesn't happen with the update() or delete() method, just with save(). Here is the code i'm using: DbEntity dbEntity = getDbEntity(); HibernateUtil.beginTransaction(); Session session = HibernateUtil.getCurrentSession(); session.save(dbEntity); HibernateUtil.rollbackTransaction(); And here is the HibernateUtil class (just the involved functions, i guarantee the getSessionFactory() method works well - there is an Interceptor handler, but it doesn't matter now): private static final ThreadLocal<Session> threadSession = new ThreadLocal<Session>(); private static final ThreadLocal<Transaction> threadTransaction = new ThreadLocal<Transaction>(); /** * Retrieves the current Session local to the thread. * <p/> * If no Session is open, opens a new Session for the running thread. * * @return Session */ public static Session getCurrentSession() throws HibernateException { Session s = (Session) threadSession.get(); try { if (s == null) { log.debug("Opening new Session for this thread."); if (getInterceptor() != null) { log.debug("Using interceptor: " + getInterceptor().getClass()); s = getSessionFactory().openSession(getInterceptor()); } else { s = getSessionFactory().openSession(); } threadSession.set(s); } } catch (HibernateException ex) { throw new HibernateException(ex); } return s; } /** * Start a new database transaction. */ public static void beginTransaction() throws HibernateException { Transaction tx = (Transaction) threadTransaction.get(); try { if (tx == null) { log.debug("Starting new database transaction in this thread."); tx = getCurrentSession().beginTransaction(); threadTransaction.set(tx); } } catch (HibernateException ex) { throw new HibernateException(ex); } } /** * Rollback the database transaction. */ public static void rollbackTransaction() throws HibernateException { Transaction tx = (Transaction) threadTransaction.get(); try { threadTransaction.set(null); if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) { log.debug("Tyring to rollback database transaction of this thread."); tx.rollback(); } } catch (HibernateException ex) { throw new HibernateException(ex); } finally { closeSession(); } } Thanks

    Read the article

  • Shrinking a large transaction log on a full drive

    - by Sam
    Someone fired off an update statement as part of some maintenance which did a cross join update on two tables with 200,000 records in each. That's 40 trillion statements, which would explain part of how the log grew to 200GB. I also did not have the log file capped, which is another problem I will be taking care of server wide - where we have almost 200 databases residing. The 'solution' I used was to backup the database, backup the log with truncate_only, and then backup the database again. I then shrunk the log file and set a cap on the log. Seeing as there were other databases using the log drive, I was in a bit of a rush to clean it out. I might have been able to back the log file up to our backup drive, hoping that no other databases needed to grow their log file. Paul Randal from http://technet.microsoft.com/en-us/magazine/2009.02.logging.aspx Under no circumstances should you delete the transaction log, try to rebuild it using undocumented commands, or simply truncate it using the NO_LOG or TRUNCATE_ONLY options of BACKUP LOG (which have been removed in SQL Server 2008). These options will either cause transactional inconsistency (and more than likely corruption) or remove the possibility of being able to properly recover the database. Were there any other options I'm not aware of?

    Read the article

  • Fixing "Lock wait timeout exceeded; try restarting transaction" for a 'stuck" Mysql table?

    - by Tom
    From a script I sent a query like this thousands of times to my local database: update some_table set some_column = some_value I forgot to add the where part, so the same column was set to the same a value for all the rows in the table and this was done thousands of times and the column was indexed, so the corresponding index was probably updated too lots of times. I noticed something was wrong, because it took too long, so I killed the script. I even rebooted my computer since them, but something stuck in the table, because simple queries take a very long time to run and when I try dropping the relevant index it fails with this message: Lock wait timeout exceeded; try restarting transaction It's an innodb table, so stuck the transaction is probably implicit. How can I fix this table and remove the stuck transaction from it?

    Read the article

  • Getting really weird entries in Apache log from Baidu.com?

    - by Undo
    I was looking through my server logs today, and I noticed this: (it's all one row) 118.244.179.250 - - [16/Oct/2013:20:59:25 +0000] "GET http://www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttphttp/www.baidu.comhttphttphttphttphttp/www.baidu.comhttphttphttphttp/www.baidu.comhttphttphttp/www.baidu.comhttphttp/www.baidu.comhttp/www.baidu.com/ HTTP/1.1" 301 4605 "http://www.baidu.com/" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)" "GET http://www.baidu.comhttphttphttphttphttp...? Am I doing something wrong? Am I hosting someone else's website without knowing it? Is a guy named baidu trying to drive me crazy?

    Read the article

  • SQL SERVER – Detect Virtual Log Files (VLF) in LDF

    - by pinaldave
    In one of the recent training engagements, I was asked if it true that there are multiple small log files in the large log file (LDF). I found this question very interesting as the answer is yes. Multiple small Virtual Log Files commonly known as VLFs together make an LDF file. The writing of the VLF is sequential and resulting in the writing of the LDF file is sequential as well. This leads to another talk that one does not need more than one log file in most cases. However, in short, you can use following DBCC command to know how many Virtual Log Files or VLFs are present in your log file. DBCC LOGINFO You can find the result of above query to something as displayed in following image. You can see the column which is marked as 2 which means it is active VLF and the one with 0 which is inactive VLF. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • using egrep to find missing @ in log

    - by jols
    I am using the following command to find log entries that are the result of a log in to the email server: egrep '_login[^ ]' /var/log/exim_mainlog That works fine to find entries that contain content like this: P=esmtpa A=courier_login:[email protected] S=1573 id=f1cd08396,... But what I need to do is to change my grep statement, so that it finds single word logins that do not use the @ sign, like so: P=esmtpa A=courier_login:name S=1573 id=f1cd08396,... Where the log in before was "[email protected]", but in the second log entry, the log in used was only "name". Is this possible using grep or egrep, perhaps in some kind of a compound statement? Thanks much.

    Read the article

  • Free eBook - Control Your Transaction Log so it Doesn't Control You

    Download your free copy of SQL Server Transaction Log Management and see why understanding how log files work can make all the difference in a crisis. Want to work faster with SQL Server?If you want to work faster try out the SQL Toolbelt. "The SQL Toolbelt provides tools that database developers as well as DBAs should not live without." William Van Orden. Download the SQL Toolbelt here.

    Read the article

  • log parser error

    - by Preetham
    Hi Guys, I have never used log parser before.. well I am getting this error now.. i don't know the reason.. Retrieving the COM class factory for component with CLSID {8CFEBA94-3FC2-45CA-B9A5-9EDACF704F66} failed due to the following error: 80040154. can ya help me out with this.. :)

    Read the article

  • Log MySQL Query In Kohana 3

    - by Asif
    Hi All, I am using Kohana 3. I want to log the MySQL queries being executed by an application. The reason to determine the query of type INSERT,UPDATE and DELETE which are being executed in a process and store them in another MySQL table with date-time for further reference. Can anybody tell how can I achieve this?

    Read the article

  • Seeing release markers in svn log

    - by chuanose
    Whenever we make a release of a project we'll create a tag to capture the snapshot. It will be very helpful to be able to see which revisions in the trunk history were used in certain releases. I know the TortoiseSVN revision graph shows this information, but I'm wondering if there's a way to see it in the command-line svn log? I'm coming from a Clearcase background where we'll be able to see the release labels in the history.

    Read the article

  • MySQL transaction conundrum

    - by David Faitelson
    I need to perform several inserts in a single atomic transaction. For example: start transaction; insert ... insert ... commit; However when MySQL encounters an error it aborts only the particular statement that caused the error. For example, if there is an error in the second insert statement the commit will still take place and the first insert statement will be recorded. Thus, when errors occur a MySQL transaction is not really a transaction. To overcome this problem I have used an error exit handler where I rollback the transaction. Now the transaction is silently aborted but I don't know what was the problem. So here is the conundrum for you: How can I both make MySQL abort a transaction when it encounters an error, and pass the error code on to the caller?

    Read the article

  • Is there a theory for "transactional" sequences of failing and no-fail actions?

    - by Ross Bencina
    My question is about writing transaction-like functions that execute sequences of actions, some of which may fail. It is related to the general C++ principle "destructors can't throw," no-fail property, and maybe also with multi-phase transactions or exception safety. However, I'm thinking about it in language-neutral terms. My concern is with correctly designing error handling in C++ functions that must be reliable. I would like to know what the concepts below are called so that I can learn more about them. I'm sorry that I can't ask the question more directly. Since I don't know this area I have provided an example to explain my question. The question is at the end. Here goes: Consider a sequence of steps or actions executed sequentially, where actions belong to one of two classes: those that always succeed, and those that may fail. In the examples below: S stands for an action that always succeeds (called "no-fail" in some settings). F stands for an action that may fail (for example, it might fail to allocate memory or do I/O that could fail). Consider a sequences of actions (executed sequentially from left to right): S->S->S->S Since each action in the sequence above succeeds, the whole sequence succeeds. On the other hand, the following sequence may fail because the last action may fail: S->S->S->F So, claim: a sequence has the no-fail (S) property if and only if all of its actions are no-fail. Now, I'm interested in action sequences that form "atomic transactions", with "failure atomicity," i.e. where either the whole sequence completes successfully, or there is no effect. I.e. if some action fails, the earlier ones must be rolled back. This requires that any successfully executed actions prior to a failing action must always be able to be rolled back. Consider the sequence: S->S->S->F S<-S<-S In the example above, the first row is the forward path of the transaction, and the second row are inverse actions (executed from right to left) that can be used to roll back if the final top row actions fails. It seems to me that for a transaction to support failure atomicity, the following invariant must hold: Claim: To support failure atomicity (either completion or complete roll-back on failure) all actions preceding the latest failable (F) action on the forward path (marked * in the example below) must have no-fail (S) inverses. The following is an example of a sequence that supports failure atomicity: * S->F->F->F S<-S<-S Further, if we want the transaction to be able to attempt cancellation mid-way through, but still guarantee either full completion or full rollback then we need the following property: Claim: To support failure atomicity and cancellation mid-way through execution, in the face of errors in the inverse (cancellation) path, all actions following the earliest failable (F) inverse on the reverse path (marked *) must be no-fail (S). F->F->F->S->S S<-S<-F<-F * I believe that these two conditions guarantee that an abortable/cancelable transaction will never get "stuck". My questions are: What is the study and theory of these properties called? are my claims correct? and what else is there to know? UPDATE 1: Updated terminology: what I previously called "robustness" is called atomicity in the database literature. UPDATE 2: Added explicit reference to failure atomicity, which seems to be a thing.

    Read the article

  • problem with send me log

    - by Lynnooi
    Hi, I had try to implement the send me log feature into my apps but I can't get it right. Can anyone please help me with it? In the logcat, it shows the errors: 03-29 21:23:37.636: ERROR/AndroidRuntime(820): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception 03-29 21:23:37.726: ERROR/AndroidRuntime(820): java.lang.RuntimeException: An error occured while executing doInBackground() 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at android.os.AsyncTask$3.done(AsyncTask.java:200) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:234) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:258) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at java.util.concurrent.FutureTask.run(FutureTask.java:122) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at java.lang.Thread.run(Thread.java:1058) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): Caused by: java.lang.NullPointerException 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at resonet.android.androidgallery.helloAndroid$CheckForceCloseTask.doInBackground(helloAndroid.java:1565) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at resonet.android.androidgallery.helloAndroid$CheckForceCloseTask.doInBackground(helloAndroid.java:1) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at android.os.AsyncTask$2.call(AsyncTask.java:185) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:256) 03-29 21:23:37.726: ERROR/AndroidRuntime(820): ... 4 more Thanks. Here is my code: public class helloAndroid extends Activity implements OnClickListener { public static final int DIALOG_SEND_LOG = 345350; protected static final int DIALOG_PROGRESS_COLLECTING_LOG = 3255; protected static final int DIALOG_FAILED_TO_COLLECT_LOGS = 3535122; private static final int DIALOG_REPORT_FORCE_CLOSE = 3535788; private LogCollector mLogCollector; public void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); Bundle b = this.getIntent().getExtras(); s = b.getString("specialValue").trim(); String xmlURL = ""; CheckForceCloseTask task = new CheckForceCloseTask(); task.execute(); } private void throwException() { throw new NullPointerException(); } @Override protected Dialog onCreateDialog(int id) { Dialog dialog = null; switch (id) { case DIALOG_SEND_LOG: case DIALOG_REPORT_FORCE_CLOSE: Builder builder = new AlertDialog.Builder(this); String message; if (id==DIALOG_SEND_LOG) message = "Do you want to send me your logs?"; else message = "It appears this app has been force-closed, do you want to report it to me?"; builder.setTitle("Warning") .setIcon(android.R.drawable.ic_dialog_alert) .setMessage(message) .setPositiveButton("Yes", this) .setNegativeButton("No", this); dialog = builder.create(); break; case DIALOG_PROGRESS_COLLECTING_LOG: ProgressDialog pd = new ProgressDialog(this); pd.setTitle("Progress"); pd.setMessage("Collecting logs..."); pd.setIndeterminate(true); dialog = pd; break; case DIALOG_FAILED_TO_COLLECT_LOGS: builder = new AlertDialog.Builder(this); builder.setTitle("Error") .setMessage("Failed to collect logs.") .setNegativeButton("OK", null); dialog = builder.create(); } return dialog; } class CheckForceCloseTask extends AsyncTask { @Override protected Boolean doInBackground(Void... params) { return mLogCollector.hasForceCloseHappened(); } @Override protected void onPostExecute(Boolean result) { if (result) { showDialog(DIALOG_REPORT_FORCE_CLOSE); } else Toast.makeText(getApplicationContext(), "No force close detected.", Toast.LENGTH_LONG).show(); } } public void onClick(DialogInterface dialog, int which) { switch (which) { case DialogInterface.BUTTON_POSITIVE: new AsyncTask() { @Override protected Boolean doInBackground(Void... params) { return mLogCollector.collect(); } @Override protected void onPreExecute() { showDialog(DIALOG_PROGRESS_COLLECTING_LOG); } @Override protected void onPostExecute(Boolean result) { dismissDialog(DIALOG_PROGRESS_COLLECTING_LOG); if (result) mLogCollector.sendLog("[email protected]", "Error Log", "Preface\nPreface line 2"); else showDialog(DIALOG_FAILED_TO_COLLECT_LOGS); } }.execute(); } dialog.dismiss(); } }

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >