Custom Timer in Swing Program
Can anyone please provide code for me to insert a custom timer into a
swing program? I need a clock that will run concurrently with the program. Any tips???
I have a similar problem...
Class:
import java.awt.*;
import hsa.Console;
import java.sql.Time;
import javax.swing.JTextField;
public class CustomTimer extends Thread implements Runnable
int secs = 0, mins = 0, hours = 0, day = 1, month = 1, year = 2006;
Time timer;
Thread main;
public CustomTimer ()
super ();
public void start ()
main = new Thread ();
main.start ();
public void run (JTextField pasteInHere)
while (year != 2008)
timer = new Time (hours, mins, secs);
secs++;
if (secs == 60)
secs = 0;
mins++;
if (mins == 60)
mins = 0;
hours++;
if (hours == 24)
hours = 0;
day++;
if (day == 28 & month == 2)
day = 0;
month++;
else if (day == 30 & (month == 2 | month == 4 | month == 6 | month == 9 | month == 11))
day = 0;
month++;
else if (day == 31)
day = 0;
month++;
if (month == 12)
month = 0;
year++;
try
main.sleep (100);
pasteInHere.setText ("" + day + "/" + month + "/" + year + " " + timer);
catch (InterruptedException ie)
Program:
import javax.swing.*;
import java.awt.*;
public class ClockTest extends JFrame
public ClockTest ()
Container contents = getContentPane ();
setSize (500, 500);
JPanel hi = new JPanel ();
JTextField hello = new JTextField ();
CustomTimer ct = new CustomTimer ();
ct.run (hello);
hi.add (hello);
contents.add (hi);
public static void main (String[] args)
new ClockTest ().show ();
Can anyone tell me why the clock does not run concurrently with the program?
Similar Messages
-
Incompatible in unix? calculating cpu time in swing ?
I am confused about the fact that when I run my swing program in netbeans on windows xp platform. The buttons have the ability to traverse the focus around using TAB key. But when I run the program in unix, the TAB key has no effect on the focus at all. I really want the TAB key to work !!!
Also, anyone knows if java has a method to calculate cpu time? I can only use System.currentTimeMillis() to measure the wall clock time. But I will need the actual cpu time spent on that particular thread.
Can somebody help ? Thanks !!!the TAB key has no effect on the focus at all. I
really want the TAB key to work !!!This is an OS specific thing, not a Java thing
Also, anyone knows if java has a method to calculate
cpu time? I can only use System.currentTimeMillis()
to measure the wall clock time. But I will need theNo. No such method exists. However you can use diagnostic packages like JProbe -
Hi,
I have a requirement to create a customized operation in TIME module.
I have been given a reference of t-code PDSY which is used to create documentation for a HR Document.
I need help with the following:
1. What is the t-code to create a customized time operation?
2. Any info. on how to create a customized time operation?
Thanks,
SaleemSaleem,
Why dont you go and check the coding for OUTWP operation in PE04.
give operation as OUTWP and DISPLAY.
In the top you will see button for disp/change, where used, SOURCE CODE, documentation.
click on SOURCE CODE and you will be able to see 2 programs. Check how the programming is done for OUTWP. Specially the second program.
Depending on the parameter like cost center or plant etc different variable keys are passed back.
This should give you an idea on how you should be able to create your custom operation. Take the help of an ABAPer to understand it better.
All the best
Ajay -
Beginning Swing programming problem
My classmates and I are trying to write a simple Swing program with a single button and a text field that contains the number of times the button has been pressed since the program started. The problem is that in the ActionPerformed method, any changes to the text field ends up with multiple event errors. It will print the count fine to the command prompt, but not the GUI. Any insight would be greatly appreciated.
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class CounterGUI extends JFrame implements ActionListener
public int count = 0;
Container contents = getContentPane();
JTextField counter;
final String temp = "Total times pressed: ";
public CounterGUI()
final int width = 300;
final int height = 300;
setSize(width, height);
JTextField counter = new JTextField(temp + count);
counter.setEditable(false);
JButton clicker = new JButton("Click me!");
clicker.addActionListener(this);
clicker.setActionCommand("Click");
contents.add(counter, "Center");
contents.add(clicker, "South");
public void actionPerformed(ActionEvent e)
String command = e.getActionCommand();
if(command == "Click")
count++;
counter.setText(temp + count);
System.out.println(count);
public static void main(String[] args)
JFrame f = new CounterGUI();
f.addWindowListener(new WindowCloser());
f.setVisible(true);Hi Guys,
The line JTextField counter = new JTextField(temp + count); is declared in the constructor, this means that the field counter is not visible to other methods and you'll get a null pointer exception (NPE) when you try to access the class field counter
Change to counter = new JTextField(temp + count); Now if you were catching and displaying exceptions you'd notice that this was happening.
Dave -
Keyboard-lock of swing program on Linux box
We are developing swing program on Linux, and we often meet keyboard-lock issues.
I try to simplify some of them to small programs, and still meet keyboard-lock.
Here I post two programs to show the error:
//---first ----------------------------------------------
package test;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
public class KeyLock extends JFrame {
JPanel contentPanel = new JPanel();
JPanel wizardToolPan = new JPanel();
JButton btnBack = new JButton("Back");
JButton btnNext = new JButton("Next");
JButton btnAbout = new JButton("About");
public static final String aboutMsg =
"<html> This program will help to find keyboard lock problems, two way to reproduce:<br><br>" +
"1 - press Alt+N to navigate next, and don't release keys untill there are no more next page, <br>" +
"then try Alt+B to navigate back and also don't release keys untill page 0,<br>" +
"repeat Alt+N and Alt+B again and again, keyboard will be locked during navigating. <br><br>" +
"2 - press Alt+A in main window, it will popup an about dialog,<br>" +
"then press down space key and don't release, <br>" +
"the about dialog will be closed and opened again and again,<br>" +
"keyboard will be locked sooner or later." +
"</html>";
public KeyLock() {
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setTitle("Keyboard lock test");
getContentPane().setLayout(new BorderLayout());
btnBack.setMnemonic('B');
btnBack.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
KeyLock.this.goBack(e);
btnNext.setMnemonic('N');
btnNext.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
KeyLock.this.goNext(e);
btnAbout.setMnemonic('A');
btnAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(KeyLock.this, aboutMsg, "About", JOptionPane.INFORMATION_MESSAGE);
contentPanel.setLayout(new BorderLayout());
contentPanel.setPreferredSize(new Dimension(400, 250));
contentPanel.setMinimumSize(new Dimension(400, 250));
wizardToolPan.setLayout(new FlowLayout());
wizardToolPan.add(btnBack);
wizardToolPan.add(btnNext);
wizardToolPan.add(btnAbout);
this.getContentPane().add(contentPanel, java.awt.BorderLayout.CENTER);
this.getContentPane().add(wizardToolPan, java.awt.BorderLayout.SOUTH);
this.setSize(400, 300);
this.createContentPanels();
this.showCurrent();
private Vector<JPanel> slides = new Vector<JPanel>();
private int current = 0;
private void createContentPanels() {
for (int j = 0; j < 20; ++j) {
JPanel p = new JPanel(new FlowLayout());
p.add(new JLabel("Page: " + j));
p.add(new JTextField("Page: " + j + ", input something here", 20));
p.add(new JTextField("Page: " + j + ", input something here", 20));
p.add(new JTextField("Page: " + j + ", input something here", 20));
p.add(new JLabel("Input something in password box:"));
p.add(new JPasswordField(20));
p.add(new JCheckBox("Try click here, focus will be here."));
p.add(new JRadioButton("Try click here, focus will be here."));
slides.add(p);
public void showCurrent() {
if (current < 0 || current >= slides.size())
return;
JPanel p = slides.get(current);
this.contentPanel.add(p, java.awt.BorderLayout.CENTER);
this.pack();
Component[] comps = p.getComponents();
if (comps.length > 0) {
comps[0].requestFocus(); // try delete this line
this.repaint();
public void goNext(ActionEvent e) {
if (current + 1 >= slides.size())
return;
this.contentPanel.remove(slides.get(current));
current++;
sleep(100);
this.showCurrent();
public void goBack(ActionEvent e) {
if (current <= 0)
return;
this.contentPanel.remove(slides.get(current));
current--;
sleep(100);
this.showCurrent();
public static void sleep(int millis) {
try {
Thread.sleep(millis);
} catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) {
KeyLock wizard = new KeyLock();
wizard.setVisible(true);
}The first program will lead to keyboard-lock in RHEL 4 and red flag 5, both J2SE 5 and 6.
//---second -----------------------------------------
package test;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class KeyFocusLost extends JFrame {
private JButton btnPopup = new JButton();
private JTextField jTextField1 = new JTextField();
private JPasswordField jPasswordField1 = new JPasswordField();
private JPanel jPanel1 = new JPanel();
private JScrollPane jScrollPane3 = new JScrollPane();
private JTree jTree1 = new JTree();
private JButton btnAbout = new JButton("About");
public static final String aboutMsg =
"<html> This program is used to find keyboard focus lost problem.<br>" +
"Click 'popup' button in main window, or select any node in the tree and press F6,<br>" +
"a dialog popup, and click ok button in the dialog,<br>" +
"keyboard focus will lost in main window." +
"</html>";
public KeyFocusLost() {
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setTitle("Keyboard focus test");
getContentPane().setLayout(null);
btnPopup.setBounds(new Rectangle(33, 482, 200, 35));
btnPopup.setMnemonic('P');
btnPopup.setText("Popup and lost focus");
btnPopup.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PopupDialog dlg = new PopupDialog(KeyFocusLost.this);
dlg.setVisible(true);
btnAbout.setBounds(new Rectangle(250, 482, 100, 35));
btnAbout.setMnemonic('A');
btnAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(KeyFocusLost.this, aboutMsg, "About", JOptionPane.INFORMATION_MESSAGE);
jTextField1.setText("Try input here, and try input in password box below");
jTextField1.setBounds(new Rectangle(14, 44, 319, 29));
jPasswordField1.setBounds(new Rectangle(14, 96, 319, 29));
jPanel1.setBounds(new Rectangle(14, 158, 287, 291));
jPanel1.setLayout(new BorderLayout());
jPanel1.add(new JLabel("Select any node in the tree and press F6."), java.awt.BorderLayout.NORTH);
jPanel1.add(jScrollPane3, java.awt.BorderLayout.CENTER);
jScrollPane3.getViewport().add(jTree1);
Object actionKey = "popup";
jTree1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F6, 0), actionKey);
jTree1.getActionMap().put(actionKey, new AbstractAction() {
public void actionPerformed(ActionEvent e) {
PopupDialog dlg = new PopupDialog(KeyFocusLost.this);
dlg.setVisible(true);
this.getContentPane().add(jTextField1);
this.getContentPane().add(jPasswordField1);
this.getContentPane().add(jPanel1);
this.getContentPane().add(btnPopup);
this.getContentPane().add(btnAbout);
public static void main(String[] args) {
KeyFocusLost keytest = new KeyFocusLost();
keytest.setSize(400, 600);
keytest.setVisible(true);
static class PopupDialog extends JDialog {
private JButton btnOk = new JButton();
public PopupDialog(Frame owner) {
super(owner, "popup dialog", true);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
this.getContentPane().setLayout(null);
btnOk.setBounds(new Rectangle(100, 100, 200, 25));
btnOk.setMnemonic('O');
btnOk.setText("OK, then focus lost");
btnOk.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PopupDialog.this.getOwner().toFront();
try {
Thread.sleep(100); // try delete this line !!!
} catch (Exception ex) {
ex.printStackTrace();
PopupDialog.this.dispose();
this.getContentPane().add(btnOk);
this.getRootPane().setDefaultButton(btnOk);
this.setSize(400, 300);
}The second program will lead to keyboard-focus-lost in RHEL 3/4 and red flag 4/5, J2SE 5, not in J2SE 6.
And I also tried java demo program "SwingSet2" in red flag 5, met keyboard-lock too.
I guess it should be some kind of incompatibleness of J2SE with some Linux platform. Isn't it?
Please help, thanks.Hi.
I have same problems on Ubuntu with Java 6 (all versions). I would like to use NetBeans or IntelliJ IDEA but it is not possible due to keyboard locks.
I posted this bug
https://bugs.launchpad.net/ubuntu/+bug/174281
before I found some info about it:
http://forums.java.net/jive/thread.jspa?messageID=189281
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6506617
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6568693
I don't know from which part this bug comes, but I wonder why it isn't fixed yet. Does anybody else use NetBeans or IntelliJ IDEA on linux with Java 6 ?
(I cannot insert link :\ ) -
How do I set a custom time & date format in the top bar?
Hello guys,
Very embarassing question, because I've had Apple's for all of my life (starting with the original Apple Macintosh) but I still haven't figured out one thing
How do I set a custom time & date format in the top bar?
When I go to System Preferences > Language & Text > Formats I can set different formats. I have no idea where you will see these, but I know that it's not the top bar where the time and date is being displayed. Because no matter what I enter, the format in the top bar will stay the same. I can only choose things like 24-Hour clock or not, blinking dots and so on in the Time & Date settings from the System Preferences.
Can anyone here point me in the right direction? I see you can even choose to display the week of the year - I'd love to do that!
All help appreciated!
GreetingsLanguage & Text system preferences, Formats tab, customize dates.
There are also many third party menu item utilities that can. Search Macupdate.com for some.
One search yielded iClock Pro. Although I never used it I would think it allows customization. The link I gave you is to the Macupdate download page for that app. On that same page is a Similar Software section which has other apps that can do the same thing.
One listed is iStat Menus. The primary use for iStat Menus is not for displaying date/time but it does do that. And I know it can do what you want because I use iStat Menus to track temperature sensors n my machine and, like you, I want to customize the menu time/date. So I use it instead of the apple clock. It does have the customization features I think you are looking for. -
How to change system time through java program
Hi
I want to know, how to change system time through java program.
give me a idia with example.
ThanksThere isn't any core Java API for this. Use JNI or call an external process with Runtime.exec().
~ -
Error while running Swing program on FreeBSD
Hi,
I am trying to run simple swing program "helloworld"
but while executing it gives following error on FreeBSD
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/usr/local/linux-sun-jdk1.4.2/jre/lib/i386/libawt.so: libXp.so.6:
cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
at java.awt.EventQueue.<clinit>(EventQueue.java:80)
at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1170)
at JPanels.main(JPanels.java:29)
Should i install XFree86-libs package on FreeBsd
configuration
FreeBSD 4.10-BETA (GENERIC)
I am using following packages
linux-sun-jdk-1.4.2.04 Sun Java Development Kit 1.4 for Linux
linux_base-8-8.0_4 Base set of packages needed in Linux mode (only for i386)
linux_devtools-8.0_1 Packages needed for doing development in Linux mode
libtool-1.3.5_1 Generic shared library support script
gmake-3.80_1 GNU version of 'make' utility
automake-1.4.5_9 GNU Standards-compliant Makefile generator (legacy version
GCC 2.95.4
gdb 4.18
ld 2.12.1 supported emulation elf_i386
regards
Man479This is not really a Swing question. You should install the library which satisfies the lookup of libXp.so.6 .
I quess the jre for this platform is compiled against this version. Looks to me like some X related library, maybe google can resolve a solution/package to install?
Greetz -
Running a Swing program from another program
I'm having what is most likely newbie problems since I'm relatively new to Swing programming. Basically my situation is this: I've got a program that looks at its command line parameters and either runs through a series of actions or presents a Swing GUI to allow the user to step through the actions one by one.
My problem is that I bascially don't know how to call (instantiate, declare, etc.) the GUI from my Java code. I tried implementing the GUI class with a runnable interface, but evertime I try to invoke the start on the interface I'm getting an error. I have a feeling I'm just missing something. The Swing GUI works fine if I call it on its own so it's the code the invokes it from the small command line processor that I'm goofing up somehow.
So to recap, I have a small Java app that I'm trying to call a GUI that I've built and can't seem to get the code right.
Any pointers to examples or explanation on how to accomplish the above are welcome.
Thanks,
EdThat the "2" is printed out immediately is as expected, but I don't understand why the JVM exits. The following is, AFAIK, a trimmed down version of what you are doing, and if you run it you'll see that the frame remains until you close it manually:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
public class ShowFrame {
public static void main(String[] args) {
AppFrame gui = new AppFrame();
gui.run();
private static class AppFrame extends JFrame implements Runnable {
public AppFrame() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
JButton btn = new JButton("Close");
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
AppFrame.this.dispose();
getContentPane().add(btn);
pack();
setLocationRelativeTo(null);
public void run() {
System.out.println("1");
this.setVisible(true);
System.out.println("2");
}Maybe someone else can shed some light over your problem... -
I am trying to use NI devices with Lazarus (there is no pascal section, so I post here).
When I try to run my application:
DAQmxBaseCreateTask('TaskHandle', TaskHandle);
DAQmxBaseCreateAIVoltageChan(taskHandle,'Dev1/ai0','',DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,'');
I get the following error message:
„System error 988 while loading the LabView eun-time engine (C:\Program file\....\\lvrt.dll)
nidaqmxbaselv requires a version 2010 (or compatible) LabView run-time engine. Please contact the vendor of nidaqmxbaselv to correct this problem.“
I installed LabView run-time engine 2012, but I still get the same error.
Then I tried to install LabView run-time engine 2010- the same result.
I removed LabView run-time engine 2012- same result.
I tried to install LabView run-time engine 2010 again (since I did not see it in the add/remove list)- then I noticed, that the installer shows „A newer version is already installed".
What shall I do?Hi,
Can I ask the same question too?
I am using
Windows 7 sp1 x64
Visual Studio 2010 pro
NI USB-6009
ni-daqmx base 3.4.5
I created a empty win-32 console project and putted the ANSI C Example program: acquireNScans.c with the include file and lib file of nidaqmxbase in the same folder. I added this line on the top of the source code #pragma comment(lib,"nidaqmxbase.lib"), built without any error. When I tried to run it, I got this same message.
I tried changing to shared dll mfc and delaying linking lvrt.dll, but did not work.
Looking forward to your reply.
all the best. -
How to know the run time of a program..?
Hi Gurus,
How to know the exact run time of a program....?
Suppose i've a program....I've changed the code to improve the performance.
Now i want to compare run time of older and new one...How to do this...?
Pls help me ....
Thanks and Regards,
NagarjunaHi,
go thru the below mentioned code............
data: start TYPE i,
end TYPE i,
dif TYPE i.
GET RUN TIME FIELD start.
SELECT SINGLE bukrs belnr gjahr blart budat
FROM bkpf
INTO (cc, doc, fy, doc_ty, pst_dt)
WHERE bukrs = p_bukrs
AND belnr = p_belnr
AND gjahr = p_gjahr.
GET RUN TIME FIELD end.
dif = end - start.
WRITE: /001 'Time for select',
067 ':', dif, 'microseconds'.
Reward all helpful answers.
Thanks -
Hi,
I am currently creating custom timer job to call WCF web service to perform nighty job to update employee document library metadata. If I update regular list/library items it updates correctly on a specified interval basis. However when I try to integrate
the WCF client, it throws error shown below :
Could not find default endpoint element that references contract EmployeeServiceReference.
EmployeeServiceClient in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
I followed exact instructions Andrew Connell has provided but included my logic in execute()
public
override
void Execute(Guid
targetInstanceId)
var empClient =
new
'ServiceReference.EmployeeServiceClient();
var employee = empClient.EmployeesMethod();
I have tried all approaches to manually adding app.config settings in sharepoing web.config but still it throws the error mentioned. It seems that application config and sharepoint site config binding issue still exist and cannot be resolved.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding
name="BasicHttpBinding_EmployeeService"
/>
</basicHttpBinding>
<netTcpBinding>
<binding
name="CustomBinding_EmployeeService">
<security>
<transport
protectionLevel="None"
/>
</security>
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding
name="WSHttpBinding_EmployeeService">
<security
mode="None"
/>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint
address="http://services.mycomp.com/EmployeeService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_EmployeeService"
contract="EmployeeServiceReference.EmployeeService"
name="WSHttpBinding_EmployeeService"
/>
<endpoint
address="http://services.mycomp.com/EmployeeService.svc/soap"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_EmployeeService"
contract="EmployeeServiceReference.EmployeeService"
name="BasicHttpBinding_EmployeeService"
/>
<endpoint
address="net.tcp://crmapp.mycomp.com:5050/EmployeeService.svc/tcp"
binding="netTcpBinding"
bindingConfiguration="CustomBinding_EmployeeService"
contract="EmployeeServiceReference.EmployeeService"
name="CustomBinding_EmployeeService">
<identity>
<userPrincipalName
value="[email protected]"
/>
</identity>
</endpoint>
</client>
</system.serviceModel>
Will you please help resolving this issue?Hi,
You can use any of the three approaches:-
1) Access web application's web.config programmatically in Execute() method.
http://praveenkasireddy.wordpress.com/2012/12/14/access-web-application-configuration-values-in-timer-job-sharepoint/
2) Store the configuration in xml and upload it to SharePoint document library then read from there
http://www.sharepointdynamics.net/2011/08/using-an-xml-settings-file-to-store-values-for-your-sharepoint-projects/
3) Programmatically configure a WCF endpoint.
http://msdn.microsoft.com/en-us/library/ff647110.aspx
Regards, Shruti -
Custom Timer Jobs not visible in Central Admin Job Definitions
I have multiple custom timer jobs which I was using on old farm, and it was successfully working and was visible in the Central Admin Job Definitions.
But ever since I moved to new farm, by restoring the site collections from old to new farm, and deployed the custom timer jobs on new farm, they are not visible in Central Admin Job Definitions.
I tried to change the scope of the solution to "Web Application", and deployed it's wsp in new farm, then also they are not visible in Job Definitions. But I can see them in "Farm Solutions", they have been successfully deployed.
Please suggest what should I do.public override void FeatureActivated(SPFeatureReceiverProperties properties)
SPWeb wb = properties.Feature.Parent as SPWeb;
if (wb == null)
throw new SPException("Error obtaining reference to context Site ");
// make sure the job isn't already registered
foreach (SPJobDefinition job in wb.Site.WebApplication.JobDefinitions)
if (job.Name == List_JOB_NAME)
job.Delete();
RSS listLoggerJob = new RSS(List_JOB_NAME, wb.Site.WebApplication);
SPHourlySchedule schedule = new SPHourlySchedule();
schedule.BeginMinute = 0;
schedule.EndMinute = 59;
listLoggerJob.Schedule = schedule;
listLoggerJob.Update();
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
SPWeb wb = properties.Feature.Parent as SPWeb;
// delete the job
foreach (SPJobDefinition job in wb.Site.WebApplication.JobDefinitions)
if (job.Name == List_JOB_NAME)
job.Delete(); -
As I mentioned, the program will not start on the first time that I click the icon. The hourglass appears for a second or two and then disappears.
I have to try at least 3 or more times before the program responds.
Should I try to uninstall 17 and reinstall 16.
I have already uninstalled 17 and reinstalled it.A possible cause is security software (firewall,anti-virus) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
Remove all rules for Firefox and the plugin-container from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
See:
*https://support.mozilla.org/kb/Server+not+found
*https://support.mozilla.org/kb/Firewalls
Create a new profile as a test to check if your current profile is causing the problems.
See "Creating a profile":
*https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
*http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
If the new profile works then you can transfer some files from an existing profile to the new profile, but be careful not to copy corrupted files.
*http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox -
Execution time of same program makes big difference
Hello all,
The execution time of same program in PRD system and QAS system makes big difference.
The difference of data is not much(as system copy was run on a regular time schedule. And the system enviroments are exactly the same. However, while the program only cost 2-3 seconds in QAS, it cost 7-8 minutes in PRD.
It only happens when trying to join some tables together.
I've checked the execution plans of same search, they are different:
QAS:
SQL Statement
SELECT
T_00.RANL , T_00.XALLB , T_00.REPKE , T_00.REWHR , T_00.HKONT , T_00.ZTMNAIBRX , T_00.GSART ,
T_00.ZTMHOYMNX , T_00.ZTMSBKBNX , T_00.ZTMSHDAYZ , T_00.ZTMMBHZKP , T_01.BAL_SH_CUR ,
T_01.ZTMSIHONP , T_02.SECURITY_ID , T_02.SECURITY_ACCOUNT
FROM
ZTM0108 T_00, ZTM0135 T_01, TRACV_POSCONTEXT T_02
WHERE
T_00.MANDT = '350' AND T_00.BUKRS = 'MC51' AND T_00.ZTMMCSNGX = '200806' AND
T_02.SECURITY_ACCOUNT = '0001' AND T_01.MANDT = '350' AND T_01.BUKRS = T_00.BUKRS AND
T_01.ZTMMCSNGX = T_00.ZTMMCSNGX AND T_01.PARTNER = T_00.REPKE AND T_02.MANDT = '350' AND
T_02.SECURITY_ID = T_00.RANL
Execution Plan
SELECT STATEMENT ( Estimated Costs = 666 , Estimated #Rows = 72 )
--- 12 HASH JOIN
( Estim. Costs = 666 , Estim. #Rows = 72 )
Estim. CPU-Costs = 37,505,220 Estim. IO-Costs = 663
Access Predicates
-- 9 HASH JOIN
( Estim. Costs = 268 , Estim. #Rows = 51 )
Estim. CPU-Costs = 18,679,663 Estim. IO-Costs = 267
Access Predicates
-- 6 NESTED LOOPS
( Estim. Costs = 25 , Estim. #Rows = 38 )
Estim. CPU-Costs = 264,164 Estim. IO-Costs = 25
-- 4 NESTED LOOPS
( Estim. Costs = 25 , Estim. #Rows = 27 )
Estim. CPU-Costs = 258,494 Estim. IO-Costs = 25
-- 2 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
( Estim. Costs = 25 , Estim. #Rows = 24 )
Estim. CPU-Costs = 253,454 Estim. IO-Costs = 25
Filter Predicates
1 INDEX RANGE SCAN DIFT_POS_IDENT~SA
( Estim. Costs = 1 , Estim. #Rows = 554 )
Search Columns: 1
Estim. CPU-Costs = 29,801 Estim. IO-Costs = 1
Access Predicates
3 INDEX RANGE SCAN TRACT_POSCONTEXTID
Search Columns: 2
Estim. CPU-Costs = 210 Estim. IO-Costs = 0
Access Predicates
5 INDEX UNIQUE SCAN TZPA~0
Search Columns: 2
Estim. CPU-Costs = 210 Estim. IO-Costs = 0
Access Predicates
--- 8 TABLE ACCESS BY INDEX ROWID ZTM0108
( Estim. Costs = 242 , Estim. #Rows = 2,540 )
Estim. CPU-Costs = 10,811,361 Estim. IO-Costs = 241
7 INDEX RANGE SCAN ZTM0108~0
( Estim. Costs = 207 , Estim. #Rows = 2,540 )
Search Columns: 3
Estim. CPU-Costs = 9,790,330 Estim. IO-Costs = 207
Access Predicates Filter Predicates
--- 11 TABLE ACCESS BY INDEX ROWID ZTM0135
( Estim. Costs = 397 , Estim. #Rows = 2,380 )
Estim. CPU-Costs = 11,235,469 Estim. IO-Costs = 396
10 INDEX RANGE SCAN ZTM0135~0
( Estim. Costs = 323 , Estim. #Rows = 2,380 )
Search Columns: 3
Estim. CPU-Costs = 10,288,477 Estim. IO-Costs = 323
Access Predicates Filter Predicates
PRD:
Execution Plan
SELECT STATEMENT ( Estimated Costs = 209 , Estimated #Rows = 1 )
--- 12 NESTED LOOPS
( Estim. Costs = 208 , Estim. #Rows = 1 )
Estim. CPU-Costs = 18.996.864 Estim. IO-Costs = 207
-- 9 NESTED LOOPS
( Estim. Costs = 120 , Estim. #Rows = 1 )
Estim. CPU-Costs = 10.171.528 Estim. IO-Costs = 119
-- 6 NESTED LOOPS
Estim. CPU-Costs = 27.634 Estim. IO-Costs = 0
-- 4 NESTED LOOPS
Estim. CPU-Costs = 27.424 Estim. IO-Costs = 0
1 INDEX RANGE SCAN TZPA~0
Search Columns: 1
Estim. CPU-Costs = 5.584 Estim. IO-Costs = 0
Access Predicates
--- 3 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
Estim. CPU-Costs = 210 Estim. IO-Costs = 0
Filter Predicates
2 INDEX RANGE SCAN DIFT_POS_IDENT~PT
Search Columns: 1
Estim. CPU-Costs = 210 Estim. IO-Costs = 0
Access Predicates
5 INDEX RANGE SCAN TRACT_POSCONTEXTID
Search Columns: 2
Estim. CPU-Costs = 210 Estim. IO-Costs = 0
Access Predicates
--- 8 TABLE ACCESS BY INDEX ROWID ZTM0108
( Estim. Costs = 120 , Estim. #Rows = 1 )
Estim. CPU-Costs = 10.143.893 Estim. IO-Costs = 119
7 INDEX RANGE SCAN ZTM0108~0
( Estim. Costs = 119 , Estim. #Rows = 1 )
Search Columns: 4
Estim. CPU-Costs = 10.142.167 Estim. IO-Costs = 119
Access Predicates Filter Predicates
--- 11 TABLE ACCESS BY INDEX ROWID ZTM0135
( Estim. Costs = 89 , Estim. #Rows = 1 )
Estim. CPU-Costs = 8.825.337 Estim. IO-Costs = 88
10 INDEX RANGE SCAN ZTM0135~0
( Estim. Costs = 88 , Estim. #Rows = 1 )
Search Columns: 4
Estim. CPU-Costs = 8.823.742 Estim. IO-Costs = 88
Access Predicates Filter Predicates
Could anyone tell me the reason? I've found note 724545 but not sure.
And, how to read the execution plan?(1 first or 12 first?)
Best Regards,
RobinHello Michael.
Thank you.
However, the sql statement is same:
QAS:
SQL Statement
SELECT
T_00.RANL , T_00.XALLB , T_00.REPKE , T_00.REWHR , T_00.HKONT , T_00.ZTMNAIBRX , T_00.GSART ,
T_00.ZTMHOYMNX , T_00.ZTMSBKBNX , T_00.ZTMSHDAYZ , T_00.ZTMMBHZKP , T_01.BAL_SH_CUR ,
T_01.ZTMSIHONP , T_02.SECURITY_ID , T_02.SECURITY_ACCOUNT
FROM
ZTM0108 T_00, ZTM0135 T_01, TRACV_POSCONTEXT T_02
WHERE
T_00.MANDT = '350' AND T_00.BUKRS = 'MC51' AND T_00.ZTMMCSNGX = '200806' AND
T_02.SECURITY_ACCOUNT = '0001' AND T_01.MANDT = '350' AND T_01.BUKRS = T_00.BUKRS AND
T_01.ZTMMCSNGX = T_00.ZTMMCSNGX AND T_01.PARTNER = T_00.REPKE AND T_02.MANDT = '350' AND
T_02.SECURITY_ID = T_00.RANL
Execution Plan
SELECT STATEMENT ( Estimated Costs = 666 , Estimated #Rows = 72 )
--- 12 HASH JOIN
( Estim. Costs = 666 , Estim. #Rows = 72 )
Estim. CPU-Costs = 37,505,220 Estim. IO-Costs = 663
Access Predicates
-- 9 HASH JOIN
( Estim. Costs = 268 , Estim. #Rows = 51 )
Estim. CPU-Costs = 18,679,663 Estim. IO-Costs = 267
Access Predicates
-- 6 NESTED LOOPS
( Estim. Costs = 25 , Estim. #Rows = 38 )
Estim. CPU-Costs = 264,164 Estim. IO-Costs = 25
-- 4 NESTED LOOPS
( Estim. Costs = 25 , Estim. #Rows = 27 )
Estim. CPU-Costs = 258,494 Estim. IO-Costs = 25
-- 2 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
( Estim. Costs = 25 , Estim. #Rows = 24 )
Estim. CPU-Costs = 253,454 Estim. IO-Costs = 25
Filter Predicates
1 INDEX RANGE SCAN DIFT_POS_IDENT~SA
( Estim. Costs = 1 , Estim. #Rows = 554 )
Search Columns: 1
Estim. CPU-Costs = 29,801 Estim. IO-Costs = 1
Access Predicates
3 INDEX RANGE SCAN TRACT_POSCONTEXTID
Search Columns: 2
Estim. CPU-Costs = 210 Estim. IO-Costs = 0
Access Predicates
5 INDEX UNIQUE SCAN TZPA~0
Search Columns: 2
Estim. CPU-Costs = 210 Estim. IO-Costs = 0
Access Predicates
--- 8 TABLE ACCESS BY INDEX ROWID ZTM0108
( Estim. Costs = 242 , Estim. #Rows = 2,540 )
Estim. CPU-Costs = 10,811,361 Estim. IO-Costs = 241
7 INDEX RANGE SCAN ZTM0108~0
( Estim. Costs = 207 , Estim. #Rows = 2,540 )
Search Columns: 3
Estim. CPU-Costs = 9,790,330 Estim. IO-Costs = 207
Access Predicates Filter Predicates
--- 11 TABLE ACCESS BY INDEX ROWID ZTM0135
( Estim. Costs = 397 , Estim. #Rows = 2,380 )
Estim. CPU-Costs = 11,235,469 Estim. IO-Costs = 396
10 INDEX RANGE SCAN ZTM0135~0
( Estim. Costs = 323 , Estim. #Rows = 2,380 )
Search Columns: 3
Estim. CPU-Costs = 10,288,477 Estim. IO-Costs = 323
Access Predicates Filter Predicates
PRD:
SQL Statement
SELECT
T_00.RANL , T_00.XALLB , T_00.REPKE , T_00.REWHR , T_00.HKONT , T_00.ZTMNAIBRX , T_00.GSART ,
T_00.ZTMHOYMNX , T_00.ZTMSBKBNX , T_00.ZTMSHDAYZ , T_00.ZTMMBHZKP , T_01.BAL_SH_CUR ,
T_01.ZTMSIHONP , T_02.SECURITY_ID , T_02.SECURITY_ACCOUNT
FROM
ZTM0108 T_00, ZTM0135 T_01, TRACV_POSCONTEXT T_02
WHERE
T_00.MANDT = '500' AND T_00.BUKRS = 'MC51' AND T_00.ZTMMCSNGX = '200806' AND
T_02.SECURITY_ACCOUNT = '0001' AND T_01.MANDT = '500' AND T_01.BUKRS = T_00.BUKRS AND
T_01.ZTMMCSNGX = T_00.ZTMMCSNGX AND T_01.PARTNER = T_00.REPKE AND T_02.MANDT = '500' AND
T_02.SECURITY_ID = T_00.RANL
Execution Plan
SELECT STATEMENT ( Estimated Costs = 209 , Estimated #Rows = 1 )
--- 12 NESTED LOOPS
| ( Estim. Costs = 208 , Estim. #Rows = 1 )
| Estim. CPU-Costs = 18.996.864 Estim. IO-Costs = 207
|-- 9 NESTED LOOPS
| | ( Estim. Costs = 120 , Estim. #Rows = 1 )
| | Estim. CPU-Costs = 10.171.528 Estim. IO-Costs = 119
| |-- 6 NESTED LOOPS
| | | Estim. CPU-Costs = 27.634 Estim. IO-Costs = 0
| | |-- 4 NESTED LOOPS
| | | | Estim. CPU-Costs = 27.424 Estim. IO-Costs = 0
| | | |-----1 INDEX RANGE SCAN TZPA~0
| | | | Search Columns: 1
| | | | Estim. CPU-Costs = 5.584 Estim. IO-Costs = 0
| | | | Access Predicates
| | | --- 3 TABLE ACCESS BY INDEX ROWID DIFT_POS_IDENT
| | | | Estim. CPU-Costs = 210 Estim. IO-Costs = 0
| | | | Filter Predicates
| | | -
2 INDEX RANGE SCAN DIFT_POS_IDENT~PT
| | | Search Columns: 1
| | | Estim. CPU-Costs = 210 Estim. IO-Costs = 0
| | | Access Predicates
| | -
5 INDEX RANGE SCAN TRACT_POSCONTEXTID
| | Search Columns: 2
| | Estim. CPU-Costs = 210 Estim. IO-Costs = 0
| | Access Predicates
| --- 8 TABLE ACCESS BY INDEX ROWID ZTM0108
| | ( Estim. Costs = 120 , Estim. #Rows = 1 )
| | Estim. CPU-Costs = 10.143.893 Estim. IO-Costs = 119
| -
7 INDEX RANGE SCAN ZTM0108~0
| ( Estim. Costs = 119 , Estim. #Rows = 1 )
| Search Columns: 4
| Estim. CPU-Costs = 10.142.167 Estim. IO-Costs = 119
| Access Predicates Filter Predicates
--- 11 TABLE ACCESS BY INDEX ROWID ZTM0135
| ( Estim. Costs = 89 , Estim. #Rows = 1 )
| Estim. CPU-Costs = 8.825.337 Estim. IO-Costs = 88
10 INDEX RANGE SCAN ZTM0135~0
( Estim. Costs = 88 , Estim. #Rows = 1 )
Search Columns: 4
Estim. CPU-Costs = 8.823.742 Estim. IO-Costs = 88
Access Predicates Filter Predicates
Only difference is the client.
I see that QAS use index SA on table DIFT_POS_IDENT first, while PRD deal with table TZPA first...Is it the reason?
Best Regards,
Robin
Maybe you are looking for
-
Hi All, While surfing some SAP groups, I came across the full form of BASIS. I was wondering whether it is authentic or just someone throwing a prank. As per them BASIS stands for : <b>Business Application Software Integration System</b> Seems to goo
-
Where are my contacts in the Backup Assistant for Droid X????
I have a Motorola Android X2. I want to edit and delete some of my contacts. I get the message that says I cannot from my phone, but have to use the backup assistant online. However, the only contacts that show up online are the contacts I've added
-
Hi All, I have a query reg hierarchies.. I have a Dim A which will be made in to two alias tables in physical layer as Dim Alias1 and Dim Alias2 , these both are connected to fact table separately... I mean in STAR form.. When i pull these tables to
-
When selecting "Rotate Pages" from the "Document" drop down menu Acrobat 8 Professional 8.1.2 crashes. Every time, no error mesage. Have run "Repair Acrobat Installation" with no success. Any suggestions? Thanks.
-
We have ERP 7.01 we are planning to installed EHP5 on it How to Install EHP5 we already configure solution manager maintenance optimizer during create stack file option technical usage type ( I am unable to understand which usage type I select ) Is t