Argh: Timers get finalized when calling Thread is finalized!
I'm hunting a bug in my application where a global static cash is not refreshed anymore after the first thread that using the cache (and therefore creating the cache and its refersh timer initially) is exiting.
Is there some JVM internal automatism that all timers that were created through (not by!) a thread will stop when this thread exits? Even though the timer was created within the singleton object that is held by a static field and therefore is always there?
I use 1.5.0_04 on Windows (Sun J2SDK).
Well, in my case it's not that simple, of course. I
don't see a static referecne in your code for the
object that creates the timer, That's true, but you will instead notice that the timer reference falls out of scope.
for example.
I also don't have any join() calls for my threads.I do only have that join so that the main thread will know when the timer has been created.
And perhaps your thread doesn't schedule the task,
but your main app. Check the code, both the main thread, and my own thread schedules one task each.
Other than that you should end
your application by waiting a while so that the
garbage collector get's a chance to gc your thread
(and call finalizers, perhaps). To see if your timer
still works.Both threads ends their execution, but the thread created by the timer still executes. This is a sample output.
First thread exits
Executing Task from first thread
Main thread exits
Executing Task from main thread
Executing Task from main thread
Executing Task from first thread
Executing Task from first thread
Executing Task from main thread
Executing Task from main thread
Executing Task from first thread
Executing Task from first threadWhere task from first only indicates that is is my own thread that posted the task (the same thread that created the timer). Task from main thread does only indicate that that task was created by the main thread.
/Kaj
Similar Messages
-
10 ms overhead when calling Thread.sleep on Linux
Hi,
I have been working on a traffic shaping simulation that requires me to send packets on a ms basis. When I call Thread.sleep(11) on Linux 2.4, I get a constant return around 30 ms. I tried to bypass the Thread.sleep function and called directly the select() function under linux with a timeout of 11 ms then I get a constant return around 20 ms. Then if I create a test.c program that loop 100 times calling the select(11), I get a very accurate rate around 10-11 ms. Anyone knows where that 10 ms overhead comes from? I tried executing the java program with Thread.sleep and the -XX:ForceTimeHighResolution but it doesn;t seem to change anything ! Any info would be very welcome ! ThanksActually I get this behavior only on a machine with kernel 2.4. On a different machine with kernel 2.6 I get an accuracy of 10ms for a select call with 10 ms timeout. I know there was some improvements on the jiffy for kernel2.6 but I still don't get why calling select timeout 10ms from a C program return an accuracy of 10ms on linux 2.4 and the same select() timeout 10ms called from java return an accuracy of only 20 ms on kernel 2.4..... :( still looking
-
Phone gets hot when calls for 5 min
Iphone 6
64gb storage
Just charged for 89% and unpullged charger n called for 5 min.. after call end phone back gets hot..it depends how hot it is, but it is normal for the phone to get hot when it uses the communication chip.
-
Getting error when calling package from master
Hi ,
I am facing one issue ,
when i am running package indivisually its running fine , but when I am calling same package from Master package it gets failded.
below is the error massage which I am getting.
"Exception has been thrown by the target of an invocation"
regards,
Vipin jha
Thankx & regards, Vipin jha MCPHi Vipin,
In addition, here is an article regarding how to execute a package from another package for your reference. Please see:
http://svangasql.wordpress.com/2012/05/01/parent-child-package-ssis-2012-execute-package-task/
Please help to elaborate your issue with more detail so that we can help you to solve this issue in a effecive manner.
Elvis Long
TechNet Community Support -
Dropdown getting deleted , when called in popup
Hi All,
When i press a button on my main view i call a popup view.
In the popup view i need to add dropdowns on "Add dropdown Button"
When i press the button once the dropdown is created.
When i press the button for second time the second dropdown doesnt gets created.
In debugging i can just see that the navigation goes to onaction of the add button and then modify view.
and then nothing happens.
Can some one please help me with this?
Edited by: Bhanu Malik on Mar 21, 2011 4:02 AM
Edited by: Bhanu Malik on Mar 21, 2011 5:55 AMOn Add dropdown
lo_nd_cn_rulehead_edit2->bind_table( new_items = lt_cn_rulehead_edit2 set_initial_elements = abap_true ).
cl_wd_dropdown_by_idx=>new_dropdown_by_idx(
EXPORTING
bind_texts = 'CN_RULEHEAD_EDIT2.CA_RULEHEAD_EDIT2'
id = 'EDIT_DROP2'
RECEIVING
control = lr_input1 ).
when i press the button again (this dropdown doesnt gets created)
cl_wd_dropdown_by_idx=>new_dropdown_by_idx(
EXPORTING
bind_texts = 'CN_RULEHEAD_EDIT3.CA_RULEHEAD_EDIT3'
id = 'EDIT_DROP3'
RECEIVING
control = lr_input2 ).
lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_input2 ).
lr_input2->set_layout_data( lr_matrix ).
wd_comp_controller->lr_container->add_child(
the_child = lr_input2
I think there is some other problem of modify view because when first dropdown is created it works fine
and when second dropdown is created it gives problem -
ALV not getting refreshed when call screen is executed second time
I have 2 screens 9001 and 9002. In 9001 , I am displaying the fields of a database table in a Table Control. The user has to select some of those fields and click on a button 'Generate ALV'. After clicking , the control navigates to 9002 where I am displaying ALV with data in the selected fields(the other fields remain empty). (using custom container)
Now there is BACK button in 9002 where i have written LEAVE TO SCREEN 9001. After this if the user again make changes in column selection and click on 'Generate ALV' , then still the old alv data is displayed. (Mind you the structure of alv is same , only the selected fields should show data).
I am using REFRESH_ALV_DISPLAY also and when i tested this function independently , its working fine (although for interactive alv in the same screen).
I am making use of <fs> for dynamic internal table and i checked it using breakpoints , during the 2nd time , it contains the correctly updated data so i think the problem lies with alv
Kindly check this code
MODULE STATUS_9002 OUTPUT.
SET PF-STATUS 'ZALV'.
* SET TITLEBAR 'xxx'.
CREATE OBJECT C_CONT
EXPORTING
CONTAINER_NAME = 'CUST_CONT'
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF OBJ_ALV IS INITIAL.
CREATE OBJECT OBJ_ALV
EXPORTING
I_PARENT = C_CONT
CALL METHOD OBJ_ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = INP_TABLE
CHANGING
IT_OUTTAB = <itab>
ELSE.
CALL METHOD OBJ_ALV->REFRESH_TABLE_DISPLAY
ENDIF.
ENDMODULE. " STATUS_9002 OUTPUT
Edited by: amber22 on Sep 16, 2011 6:45 PMAmber,
Something like:
*& Module STATUS_9001 OUTPUT
MODULE status_9001 OUTPUT.
SET PF-STATUS 'ST9001'.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9001 INPUT
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'GEN'.
SELECT * FROM spfli INTO TABLE gt_outtab.
CALL SCREEN 9002.
WHEN 'BACK'.
LEAVE.
ENDCASE.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9002 OUTPUT
MODULE status_9002 OUTPUT.
SET PF-STATUS 'ST9002'.
IF obj_alv IS INITIAL.
CREATE OBJECT c_cont
EXPORTING
container_name = 'CUST_CONT'.
CREATE OBJECT obj_alv
EXPORTING
i_parent = c_cont.
CALL METHOD obj_alv->set_table_for_first_display
EXPORTING
i_structure_name = 'SPFLI'
CHANGING
it_outtab = gt_outtab.
ELSE.
CALL METHOD obj_alv->refresh_table_display.
ENDIF.
ENDMODULE. " STATUS_9002 OUTPUT
*& Module USER_COMMAND_9002 INPUT
MODULE user_command_9002 INPUT.
CASE sy-ucomm.
WHEN 'BACK'.
CALL METHOD: obj_alv->free, c_cont->free.
CLEAR: obj_alv, c_cont.
CALL METHOD cl_gui_cfw=>flush.
LEAVE TO SCREEN 9001.
ENDCASE.
ENDMODULE. " USER_COMMAND_9002 INPUT
Altough it's not a really nice solution... Why using 2 screens for example? you could use two containers instead...
Also I would recommand playing with the new salv class for your grids.
Anyway don't hesitate to give feed-back.
Kr,
m. -
Getting error when calling stored procedure
I have created 2 stored procedures as follows
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[REAL_PUSH_UPDATE_REPORTS] AS
BEGIN TRANSACTION
DECLARE @cursor_contact_id bigint;
DECLARE cursorContactId Cursor FOR SELECT distinct(contact_id) FROM [dbo].credit_reports WHERE loan_id IS NULL;
OPEN cursorContactId;
Fetch NEXT FROM cursorContactId INTO @cursor_contact_id;
IF(@@FETCH_STATUS <> 0)
PRINT 'There are no LOAN contacts are there with loan ID null, May be you have already executed this procedure'
WHILE(@@FETCH_STATUS =0)
BEGIN
PRINT @cursor_contact_id;
EXECUTE REAL_UPDATE_REPORTS @cursor_contact_id;
Fetch NEXT FROM cursorContactId INTO @cursor_contact_id
END
CLOSE cursorContactId;
DEALLOCATE cursorContactId;
IF (@@Error = 0)
BEGIN
COMMIT TRANSACTION;
END
ELSE
BEGIN
ROLLBACK TRANSACTION;
END
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[REAL_UPDATE_REPORTS] @initial_contact_id bigint AS
BEGIN TRANSACTION
DECLARE @loan_count bigint;
DECLARE cursorLoanID Cursor FOR (SELECT l.loan_id loanIDList FROM (([dbo].loans l LEFT OUTER JOIN [dbo].loan_requests lr
ON lr.loan_id=l.loan_id
AND lr.contact_id = l.primary_borrower_id)
LEFT OUTER JOIN [dbo].loan_codes lc
ON l.loan_code_id = lc.loan_code_id)
WHERE (l.primary_borrower_id=@initial_contact_id)
AND l.active=1 UNION SELECT l.loan_id
FROM [dbo].loans l LEFT OUTER JOIN [dbo].loan_requests lr
ON lr.loan_id=l.loan_id LEFT OUTER JOIN [dbo].contacts c
ON c.contact_id =l.primary_borrower_id
WHERE (l.loan_id IN
(SELECT cb.loan_id FROM coborrowers cb where contact_id =@initial_contact_id and active = 1))
UNION
SELECT l.loan_id
FROM [dbo].loans l LEFT OUTER JOIN [dbo].loan_requests lr
ON lr.loan_id=l.loan_id LEFT OUTER JOIN [dbo].contacts c
ON c.contact_id =l.primary_borrower_id
WHERE (l.loan_id IN (SELECT cs.loan_id
FROM cosigners cs where contact_id =@initial_contact_id and active = 1)) UNION
SELECT g.loan_id FROM [dbo].groups g, [dbo].group_members gm,
[dbo].loan_requests lr WHERE gm.group_id = g.group_id
AND lr.loan_id = g.loan_id
AND lr.contact_id = gm.secondary_borrower_id
AND gm.secondary_borrower_id=@initial_contact_id and gm.active = 1)
ORDER BY loanIDList DESC;
OPEN cursorLoanID;
SET @loan_count = @@CURSOR_ROWS;
PRINT @loan_count;
IF(@loan_count > 0) BEGIN
DECLARE @loans_loan_id bigint;
Fetch NEXT FROM cursorLoanID INTO @loans_loan_id;
DECLARE @my_count bigint;
SET @my_count=1;
WHILE(@@FETCH_STATUS =0)
BEGIN
DECLARE @temp_contact_id bigint;
DECLARE @temp_loan_id bigint;
SET @temp_contact_id = @initial_contact_id;
SET @temp_loan_id = @loans_loan_id;
IF(@my_count=@loan_count)
BEGIN
UPDATE [dbo].credit_reports SET loan_id = @temp_loan_id WHERE
loan_id IS NULL AND contact_id = @initial_contact_id
AND NOT EXISTS (SELECT * FROM [dbo].credit_reports
WHERE contact_id = @initial_contact_id AND
loan_id=@temp_loan_id);
END
ELSE
BEGIN
INSERT INTO [dbo].credit_reports(contact_id,credit_bureau_id, credit_score, thirty_days_late,
sixty_days_late, ninety_days_late, currently_negative, amount_past_due,
inquiries_six_mos, public_records, collections, total_accounts_balance,
total_mthly_pymts, report_file, report_gu_id, data_entry_by, data_entry_date,
loan_id) SELECT contact_id,credit_bureau_id, credit_score, thirty_days_late,
sixty_days_late, ninety_days_late, currently_negative, amount_past_due,
inquiries_six_mos, public_records, collections, total_accounts_balance,
total_mthly_pymts, report_file, report_gu_id, data_entry_by,
data_entry_date,@temp_loan_id FROM [dbo].credit_reports WHERE contact_id
= @initial_contact_id AND loan_id IS NULL
AND NOT EXISTS (SELECT * FROM
[dbo].credit_reports WHERE contact_id=@initial_contact_id AND
loan_id=@temp_loan_id);
END
Fetch NEXT FROM cursorLoanID INTO @loans_loan_id;
SET @my_count = @my_count + 1;
END
close cursorLoanID
deallocate cursorLoanID
IF (@@Error = 0)
BEGIN
COMMIT TRANSACTION;
PRINT 'Success for contactID :'+CONVERT(varchar(50),@initial_contact_id);
END
ELSE
BEGIN
ROLLBACK TRANSACTION;
PRINT 'Failed for contactID :'+CONVERT(varchar(50),@initial_contact_id);
END
END
ELSE
BEGIN
ROLLBACK;
PRINT 'NO Loans For the contactID :'+CONVERT(varchar(50),@initial_contact_id);
ENDnow the problem is
i have executed 2 procedures saperately thn its ok while im calling im getting
Msg 16915, Level 16, State 1, Procedure REAL_UPDATE_REPORTS, Line 5
A cursor with the name 'cursorLoanID' already exists.
Msg 16905, Level 16, State 1, Procedure REAL_UPDATE_REPORTS, Line 6
The cursor is already open.Please let me know the reason...
Thank you.
Message was edited by:
User71408What the heck, that's fun..
I for one, have never seen T-sql or whatever it's called.
Looking at it, it seems that a
close cursorLoanID
deallocate cursorLoanID
is missing from the ELSE section doing the rollback.
But, only guessing
Fun, fun, fun -
How stored procedure get executed when called from java
When we create a stored procedure or function in oracle, it is compiled and stored there. From java when we call them no compilation is performed its a simple call. When a function or stored procedure is invoked from multiple instance of java objects(for a single session), does the stored procedure clone it self so that it can be called by different java objects which I think not possible at all. In such cases when one java object is interacting with the stored procedure, does other java objects go on a wait state. What happens if sessions are different.
Please help.>
does oracle creates multiple instance of a particular stored procedure for different sessions or connections. if not then there might be some kind of waiting principle followed.. what happens exactly
>
What happens exactly is detailed in Chap. 14 Memory Architecture ni the Database concepts doc
http://docs.oracle.com/cd/E14072_01/server.112/e10713/memory.htm#i21266
The code is shared but the data isn't (see the lone exception to this below).
See the section on the Library Cache
>
Program Units and the Library Cache
The library cache holds executable forms of PL/SQL programs and Java classes. These items are collectively referred to as program units.
The database processes program units similarly to SQL statements. For example, the database allocates a shared area to hold the parsed, compiled form of a PL/SQL program. The database allocates a private area to hold values specific to the session that runs the program, including local, global, and package variables, and buffers for executing SQL. If multiple users run the same program, then each user maintains a separate copy of his or her private SQL area, which holds session-specific values, and accesses a single shared SQL area.
>
The exception is when code uses the SERIALLY_REUSABLE pragma. In that case the memory for package state is in the SGA and users do not have their own copy in their UGA.
See the SERIALLY_REUSABLE pragma in the PL/SQL Language doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/seriallyreusable_pragma.htm
>
The global memory for serially reusable packages is pooled in the System Global Area (SGA), not allocated to individual users in the User Global Area (UGA). That way, the package work area can be reused. When the call to the server ends, the memory is returned to the pool. Each time the package is reused, its public variables are initialized to their default values or to NULL.
Serially reusable packages cannot be accessed from database triggers or other PL/SQL subprograms that are called from SQL statements. If you try, the database generates an error. -
Temp table gets deleted when calling another function
Hello Everyone
I am using temporary tables which gets deleted on commit to workaround a multiset union (which doesnt work on Oracle 9). Now, this table somehow gets deleted (the content) during execution of my stored procedure but there is no delete or commit statement.
Here is what I am doing
start
delete temp table (just to be sure)
prepare array
loop array {
output count of temp table
a = some other function(...)
output count of temp table
insert stuff I need to temp table
output count of temp table
end
The output is giving me (example). The correct result would be 140 at the end
0
0
100
0
40
I checked all further function calls, there is no delete or commit, just some objects are created (and collections) which are then processed and returned.
Could it be that there is a automatic commit or something like that?
Thanks
Edited by: maschlegel on Jan 26, 2009 6:36 AM
Edited by: maschlegel on Jan 26, 2009 6:37 AM
Edited by: maschlegel on Jan 26, 2009 6:38 AMjust some objects are created (and collections) which are then processed and returneAll DDL statements issue COMMITs implicitly - once before the statement is processed and once after. (so any data changes are committed even if the DDL statement fails).
This is just one reason why it is such a bad idea to stick DDL statements in the middle of transactions.
Cheers, APC
blog: http://radiofreetooting.blogspot.com -
Getting error when calling Java program from JSP page.
Hi All,
I'm getting below error msg, previously the page use to display and also java program use to run properly, but suddenly today i came across this error. May be some settings have been changed on my server, since number of developers uses this common webserver here.
Any help would be much appreciated. Pls let me know if if anyone requires much info regarding this one.
javax.servlet.ServletException: sun/tools/javac/Main
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.(Compiled Code)
at java.lang.Exception.(Compiled Code)
at javax.servlet.ServletException.(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.doService(Compiled Code)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.service(Compiled Code)
at org.apache.tomcat.facade.RequestDispatcherImpl.doForward
Root cause:
java.lang.NoClassDefFoundError: sun/tools/javac/Main
at org.apache.jasper.compiler.SunJavaCompiler.compile(Compiled Code)
at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(Compiled Code)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(Compiled Code)
at org.apache.jasper.servlet.JspServlet.loadJSP(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Compiled Code)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Compiled Code)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(Compiled Code)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
Message was edited by:
shukla_arvinddid u happen to upgrade ur jdk?????
-
Get FileNotFound when call getContent() on a ASP url
import java.net.*;
import java.io.*;
public class test {
public test(String str) throws Exception {
URL url = new URL(str);
InputStream is = (InputStream)url.getContent();
byte[] b = new byte[1000];
is.read( b );
System.out.println( new String( b ));
public static void main( String args[] ) {
try {
new test("http://dictionary.msn.com/find/editor.asp"); //FileNotFoundException, why? Bug?
//new test("http://carclick.canada.com/home.asp?sk=mon"); //It works well
} catch( Exception e ) {
e.printStackTrace();
java.io.FileNotFoundException: http://dictionary.msn.com/find/editor.asp
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at java.net.URLConnection.getContent(Unknown Source)
at java.net.URL.getContent(Unknown Source)
at test.<init>(test.java:8)
at test.main(test.java:16)
It works well with many urls except the ones in this microsoft's site. The asp file may be protected, but IE can show this webpage normally.
I'd like to know if it is a bug and how can I get content from this page.
Who can help me? Thanks a lot.It works well with many urls except the ones in this
microsoft's site. The asp file may be protected, but
IE can show this webpage normally.
I'd like to know if it is a bug and how can I get
content from this page.Microsoft is the problem. Look at the talk between your code and the M$ server:
HTTP/1.0 500 Internal Server Error.
Server: Microsoft-IIS/5.0.
Date: Mon, 25 Jun 2001 07:58:10 GMT.
PICS-Label: (PICS-1.0 "http://www.rsac.org/ratingsv01.html" l by "[email protected]" on "2000.10.26T11:30-0700" exp "2001.10.26T12:00-0700" r (v 0 s 0 n 0 l 0)).
P3P: CP="BUS CUR CONo FIN IVDo ONL OUR PHY SAMo TELo".
Content-Length: 298.
Content-Type: text/html.
Cache-Control: private.
Age: 0.
<font face="Arial" size=2>
<p>Microsoft VBScript runtime </font> <font face="Arial" size=2>error '800a000d'</font>
<p>
<font face="Arial" size=2>Type mismatch: '[string: "."]'</font>
As you can see the difference between Java's and Netscape's requests:
Java:
GET http://dictionary.msn.com/find/editor.asp HTTP/1.1.
User-Agent: Java1.3.1.
Host: dictionary.msn.com.
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2.
Proxy-Connection: keep-alive.
Netscape:
GET http://dictionary.msn.com/find/editor.asp HTTP/1.0.
Proxy-Connection: Keep-Alive.
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.5 i586).
Pragma: no-cache.
Host: dictionary.msn.com.
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*.
Accept-Encoding: gzip.
Accept-Language: de, en.
Accept-Charset: iso-8859-1,*,utf-8.
Cookie: MC1=V=2&GUID=A39CF3A9FE8A440EAC3EC7267D9D14A5.
Netscape uses some weird cookie (set elsewhere) to communicate with the M$ site. The sollution is to first get a similar cookie, and then send it with your request (you can set cookies by doing setRequestProperty() on your URLConnection: URLConnection.setRequestProperty("Cookie","MC1=V=2&GUID=A39CF3A9FE8A440EAC3EC7267D9D14A5");.
I hope this helps, but my feeling says that this is exactly the problem (M$ is trying to user track you a little bit with its nice beautiful buggy VB scripts).
-- Stephan -
Array data sporadically lost when calling stored procedure
We have weird problem with stored procedures for which I have not been able to find an explanation so far.
Our app has a bunch of stored procedures which process arrays of integers or strings.
From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ?We have weird problem with stored procedures for which I have not been able to find an explanation so far.
Our app has a bunch of stored procedures which process arrays of integers or strings.
From time to time (maybe 1 in a 1000) array data gets lost when calling stored procedures. From the logs we know that the data gets sent to the stored procedure, but on the DB side the procedure throws an exception because arrays are empty.
We are using (modified) OracleConnectionCacheImp (thus PooledConnections, etc.). My latest guess is that maybe somehow ArrayDescriptors on the (pooled)connection used to call the stored procedure are somehow affected when another pooled connection from OracleConnectionCacheImp gets removed by parallel thread. Is that possible? Or are the PooledConnections internally (in pooled connection data source) completely isolated from each other ? -
How to get informed when JPanel is displayed?
If have a separate swing component (JPanel) that is used by multiplt applications. I try to find a way for my panel to get informed when the panel is finally displayed on the screen. I tried overwriting some methods like setVisible() or paintAll(), but they are not called. Perhaps another overwritable method of JPanel that gets called when it is displayed?
You should be able to use a [url http://java.sun.com/docs/books/tutorial/uiswing/events/componentlistener.html]Component Listener.
-
Does a reentrant dll call monopolize the calling thread?
If I understand thing correctly, threading for a dll call is the same as threading for a vi whose execution priority is set to subroutine.
To review threading in subvis:
(1) the thread in which a subroutine-execution-priorty-vi call is made is monopolized by the subroutine-execution-priorty-vi since labview cannot time slice the thread.
(2) if the subroutine-execution-priority-vi is not reentrant, then other threads that call the vi may be suspended because they are competing for the same code resource.
(3) if the subroutine-execution-priority-vi is reentrant, then other threads may call the vi simultaneously. However, within any particular thread the vi must complete because of point (1).
In
sum, the OS timeslices between the threads, and labVIEW timeslices within the threads. If a vi's execution priority is set to subroutine, then the thread under which it is running is monopolized by the vi. Yes?
A reentrant dll call would be equivalent to a reentrant subvi call in which the subvi's execution priority is set to subroutine. Yes?
If the above is correct then this should also be correct:
Using an API call to return the thread ID, you could use the the thread ID at the front and back side of a dll call, as well as in a message library function callable from a dll, to theoretically message labVIEW upon the dll return. The message would be uniquely identifiable because a dll call cannot be superceded by another dll call from within the same thread. Yes?
I'm not saying that it would be particularly efficient to do so, only that it could be done. And depending on the messaging, it could be a useful option in the dll call configuration dialog box.
In consider
ation of "magic",
Kind Regards,
EricEric,
I'm not sure I understand exactlly what you are trying to do here.
If you want LV to react to a dll error, why don't you just pass a return
code that's not zero? Then, back in LV, read the return code. If it's not
zero, create an error, and pass this to the rest of the code. The rest of
the code is (or should, following good programming practise) has an error
in, and the code will not execute if the input error is TRUE. It does not
even have to be the return code, it could be any input value. The input
values can be changed in the code, and the modified value is returnd to
LabVIEW.
If you want to generate an error, and put it into a buffer to be read later
on in LV, you'll have to synchronise the code. This is the consequence for a
construction like this, and is the same for several windows API's
(GetLastError, etc.). the buffer will stay in memory, untill all instances
of the dll are released from LV memory.
BTW: A dll could create another thread. This thread can run on the
background, like the good old TRS's in dos. (A thread like this could even
call a LabVIEW VI that is build in a dll, just like any other api.)
BTW: A thread created by a dll can be made to be automatically released when
the thread is detatched, or when the process is detached. This is important,
because LV will crash if the dll is removed from memory, but the thread is
not stopped properly.
Regards,
Wiebe.
"Eric6756" wrote in message
news:[email protected]...
> Greg,
>
> As I think I lost you in the point of this line of questions, let me
> back up.
>
> A couple of week ago I asked the following question, "Is there a
> labVIEW library call that can be made from a dll to tell labVIEW to
> abort the calling vi thread?" To that question you made the following
> statement:
>
> "... and I doubt that there is a function to do that from a DLL as the
> DLL could be arbitrarily deep down the stack and the function called
> would have to magically find the VI that it wants to abort. And don't
> forget that DLLs can be called by multiple VIs at the same time."
>
> You seem to be saying here that what I'm asking for is not possible.
> And having thought about this for a while, I didn't understand why
> not.
>
> For the moment I'm going to ignore the caveat you just put into the
> dll calling presumptions I've made and assume the dll is going to
> execute synchronously within a thread. As the original question
> suggests, the objective here is to message labVIEW from a dll to
> provide the same functionallity as a CIN, namely return an error code
> to labVIEW from a dll.
>
> A library function could do this as follows:
>
> First, the library function would have two modes; set error, and
> return error
>
> (1) set error:
>
> 1.1 get the set error caller thread ID from API
> 1.2 get the passed in error
> 1.3 store the error and associated thread ID locally
>
> (2) return error
> 2.1 get return error caller thread ID from API
> 2.2 locate the error, if any, associated with thread ID
> 2.3 return the error and clear it locally
>
> Now, if a dll encountered an error that it wanted labview to deal
> with, it would call the error function to set the error code. When
> the dll call returns control to labVIEW, labVIEW could call the
> function to return the error. This of course works only if the dll
> call is synchronous within a thread. Obviously, if the dll releases
> the thread before it returns, then more than one dll call can be made
> from the thread and the presumption that an error could be uniquely
> associated with a thread is itself an error.
>
> Having looked at your reply again, I think though your answering a
> different question than I asked. I just wanted a function to message
> labVIEW to abort the vi chain, I don't want to abort a vi chain from
> within the dll. It is a feature of CIN calls which I wanted in dll
> calls.
>
> That a dll call may not be synchronous within a thread throws a wrench
> in the works. Apparently I've just chased down a dead end.
>
> Hey, but thanks for the wrench...
> Kind Regards,
> Eric -
SKYPE PREMIUM CHARGES WHEN CALLING MOBILES
Hi,
I have skype premium with unlimited calls to mobiles and landlines phones to France.
However, I am still getting charged when calling cellphones (I am getting charged on my skype credit)
Here is my skype name: jonathan.quirin1
You guys claim that by getting skype premium I have unlimited calls (mobile and landlines) toward any of the country in the list.
Why am I still getting charged?canadian_sam1 wrote:
I think that there is a connection charge fee for the operator , or some thing like that.
I have a same account from Canada to hungary and I get charged connection fee.
I know that wont help your problem but??
I wish there was a better help online from Skype.
regards
Sam
If Hungary is your selected country for telephone calling with Skype Premium, the subscription only covers calling to landline phones. Click on "Skype Premium" below and then expand the list of countries you can choose from when calling telephones. Only 4 countries have calling for both landline and mobile phones covered (USA, Canada, Hong Kong, Singapore).
You would need to either purchase Skype Credit or a country-specific subscription that also covers calling to mobile phones in that case (click on "Subscriptions" below to see the options for Hungary, or other countries). When using Skype Credit to pay for calls to telephones, there is a connection fee charged per call along with the per-minute rate. This is detailed on the "Pay As You Go" link below.
Patrick
Location/Ubicacion: Arizona USA
Time Zone/Hora Local: UTC/GMT -7
If this message has adequately addressed your issue, please click on the “Accept as Solution” button. If you found a post useful then please "Give Kudos" at the bottom of my post, so that this information can benefit others.
Si esto mensaje le ha ayudado, por favor haga clic en "Aceptar como solución". Si encuentra un mensaje útil, por favor "Da Kudos" al final del mensaje, por lo que esta información puede beneficiar a otros.
I am not a Skype employee. No soy un empleado de Skype.
Maybe you are looking for
-
Looking for HP printer App/Icon to save on desktop
Hi - I am presently using Windows 8.1 operating system. In a previous version of Windows, I had installed a HP app/icon for printing photos and saved it on my desktop screen, the app looked like a picture of a "small HP printer" and it was very conve
-
Hi, To post the data for RG23C with multiple Line Items in the <b>J1IEX</b> T-code is it advisable to use LSMW or BDC Program. B'cas through LSMW recording method the Multiple Line Items seems to be impossible to upload, and in BDC some of the screen
-
Wireless Connection Problem in Mixed Machine Enviroment
The Culprits: Mac G5 Dual 2.0ghz w Airport Extreme card (Note no Base Station) (C1) Compaq Presario Laptop AMD 3000+ Broadcom 802.11b/g WLAN (C2) The Crime: C2 has, on multiple attempts been able to connect (or claims to have done so) to a Wireless n
-
I want the underlying file name to be the pdf file name I had it working until we switched computers and now it asks for a tile. I am using cut and paste there should some way to do this. I must be missing something James
-
Firefox for Android won't install on HTC Explorer
My HTC Explorer seems to have all the requirements for Firefox to be installed. The screen resolution is 320 x 480 - more than the minimum spec. The Android version is 2.3.5. - higher than the version quoted. HTC Sense version 3.5 But when I try to i