Problem with synonyms in SQLConnections.
Hello, i`m using Oracle (R) BPM Studio Version: 10.3.2, and got some problem with SQLConnections and synonyms.
Is it possible to import synonyms table to BPM?
What i did wrong?
1) create or replace synonym x.users for y.users@TEST -> definition in Oracle
2) External resources:
Type: SQL Database
Supported Types: BPM`s Oracle Driver Versions:10,11.
no advanced options.
3) Catalog->SQLConnections -> Catalogue Component -> SQL -> choosing my configurations -> i can see all tables views but no synonym table is visible... why?
Thx for help:)
Hello Ron;
Since this is also happening in the CR designer, I really think it will be best to get an answer from the CR database guys in the Data Connectivity - Crystal Reports forum;
SAP Crystal Reports - Data Connectivity
Once it is working in the designer, see how it goes at runtime.
Ludek
Similar Messages
-
Problem while Creating MVLOG with synonym in Oracle 9i:Is it an Oracle Bug?
Hi All,
I am facing a problem while Creating MVLOG with synonym in Oracle 9i but for 10G it is working fine. Is it an Oracle Bug? or i am missing something.
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL>
SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
Table created.
SQL> create materialized view log on t;
Materialized view log created.
SQL> create public synonym syn_t for t;
Synonym created.
SQL> CREATE MATERIALIZED VIEW MV_t
2 REFRESH ON DEMAND
3 WITH PRIMARY KEY
4 AS
5 SELECT name,id
6 FROM syn_t;
Materialized view created.
SQL> CREATE MATERIALIZED VIEW LOG ON MV_t
2 WITH PRIMARY KEY
3 (name)
4 INCLUDING NEW VALUES;
Materialized view log created.
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Solaris: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 - Production
SQL>
SQL> create table t ( name varchar2(20), id varchar2(1) primary key);
Table created.
SQL> create materialized view log on t;
Materialized view log created.
SQL> create public synonym syn_t for t;
Synonym created.
SQL> CREATE MATERIALIZED VIEW MV_t
REFRESH ON DEMAND
WITH PRIMARY KEY
AS
2 3 4 5 SELECT name,id
FROM syn_t; 6
Materialized view created.
SQL> CREATE MATERIALIZED VIEW LOG ON MV_t
WITH PRIMARY KEY
(name)
INCLUDING NEW VALUES; 2 3 4
CREATE MATERIALIZED VIEW LOG ON MV_t
ERROR at line 1:
ORA-12014: table 'MV_T' does not contain a primary key constraintRegards
Message was edited by:
Avinash Tripathi
nullHi Nicloei,
Thanks for the reply. Actually i don't want any work around (Creating MVLOG on table rather than synonym is fine with me) . I just wanted to know it is actually an oracle bug or something else.
Regards
Avinash -
Problem with ORA-24372 invalid object for describe
I have unresolved problem with oracle message: ORA-24372 invalid object for describe. There is the client-server application which installed on users PCs. Client application is program on Delphi 7 that installed on several users PCs which works with Oracle DB 10g server (clients on users side 8.1.7) by means ODAC 5.7. Each user by means this application works with data on Oracle server. Each group of users uses its own schema. Each of this schema has grants to select data and execute procs in the main schema. During the time of operation I modified and compiled some procs in the main schema. As the result I found some depended Invalid objects in main schema. I recompiled them. There is no invalid objects in all schemas. But when I starts application in one user place (he uses for example schema X1) I see oracle message: ORA-24372 invalid object for describe. Other users in group which uses schema X1 works without this problem. There is finite aggregate of users of schema Х1 which has this message but some users of schema Х1 has no problem. All users has identical software and there is no any invalid objects in schemas! I try to start application on my PC using schema X1 and finds ORA-24372 then I try to start application on neighbors PC and it is all ok! It happened after I recompiled main schema in the time of users operation. What should I do to resolve this problem? Where to find the source of the problem: in client or in server?
To Mr. Sven Weller
The purpose of creation X1 (X2, Х3…) was restriction of users to access objects in the Main Schema. X1 has no any objects except function that returns her name for internal purposes. X1 has many synonyms for objects in the Main schema. There is no invalid objects in X1! -
Problem with database schema objects in the entity object wizard
Hi All,
When creating a new entity object, I am facing a problem with database schema objects in the entity object wizard, database schema objects (check boxes for tables,synonyms...) are disabled. Actually I am using a synonym but I am not able to select the synonym check box.
Can any of you folks tell me how to enable the database schema objects (check boxes for tables,synonyms...).
Thanks in Advance.
Raja.MMake sure your using rite version of jdeveloper..
Make sure your using apps schema and check whether your able perform DML operations in the schema vis sql developer.
--Prasanna -
PL/SQL Web services working with synonyms but not parameters Collection
Hi
I am Using JDeveloper 10.1.3.1.0
i could able to test successfully the PL/SQL web services with the synonyms.I created the PL/SQL web services in 'MKI' schema and then i dropped the objects from the MKI schema and launched the same in 'BAS' Schema and given grants to MKI schema and Created the Local synonyms in Schema 'MKI' and now when i test the PL/SQL web service, it is working successfully.
There was problem with passing the collection types as parameters in web services in that case it is giving the following Error
"Internal Server Error (Caught exception while handling request: java.rmi.RemoteException: java.sql.SQLException: Internal Error)"
Could any one suggest me the reason for the above error?
Regards
MalathiJust a clarification about the problem.
Even though, if an exception is raised, the Connection object will be eventually closed(), it may take a while and if there are lots of users getting exceptions at the same time the connection pool can quickly run out of connections (correct me if I am wrong please.)
That is why we think the Connection object should be immediately closed in the case of an exception is raised and we are looking for a fix for this.
Thanks
Luis -
Data Modeler: Problems with importin from DDL and Designer
I have a few problems with importing models from Designer and DDL:
1. Can I import spatial indexes from Designer or DDL file? An index does appear in the model but it doesn’t seem to be a spatial index. When trying to import from database, the index doesn’t appear in the model at all.
2. Is it possible to import sdo_geometry data types from DDL file? I haven’t succeeded with it, instead the column's data type appears unknown.
3. Sometimes import from DDL files (that are generated with DM) failed with nothing appearing to the model. I haven’t figured out why that happens. I didn’t receive any error message, the model just opened empty.
4. DM doesn’t seem to recognize public synonym creation from DDL. View log gives the following message:
<<<<< Not Recognized >>>>>
CREATE PUBLIC SYNONYM TABLE1
FOR TABLE1
5. Sequences lose their properties when importing from Designer. They only have a name but but start with, increment by and min/max values are empty in DM. Importin from DDL works fine.
I’m using data modeler version 2.0.0 build 584Hi Alex,
There is newer version of Data Modeler (3.0 EA2) and it is free
You can download it from here
http://www.oracle.com/technetwork/developer-tools/datamodeler/ea2-downloads-185792.html
Regards
Edited by: Dimitar Slavov on Dec 9, 2010 2:15 AM -
Hello everyone!
I have a small problem with respect to a multi-selection of a list with a TextInput .... this is the code:
private function createNewPlayList():void{
for (var i:int = 0; i < list2.selectedItems.length; i++){
var stat:SQLStatement = new SQLStatement();
stat.sqlConnection = connection;
stat.text = "INSERT INTO playlist (nome, canzone, lista) VALUES (@nome, @canzone, @lista)";
stat.parameters["@nome"] = list2.selectedItems[i].nome;
stat.parameters["@canzone"] = list2.selectedItems[i].base;
stat.parameters["@lista"] = txtPlayList.text;
stat.execute(-1, new Responder(selectItemsPlayList));
txtErrore2.text="Base e Testo Inseriti nel Database";
txtPlayList.text= "";
}txtPlayList is name of playlist and is "one TextInput"
Basically, with this script I do a multiselect list (and up here all ok) but what about the column "list" me only adds to the last selected list ... how do I add a lot of "list" how many are selected? ?
I hope I was clear ....
help me please....You're not adding your filefilter as an argument of browseForOpen.
ie: browseForOpen("Apri", filterTesto);
But it might not make any difference:
http://forums.adobe.com/thread/834035
And from the actionscript refence:
"Note: On Android devices, the file dialog title cannot be set. The title parameter is ignored." -
Problem with XMLDOM package (Oracle 10.2.0.1.0)
Hi,
I am using the dbms_xmldom package to generate xml files (specific structure).
Below is the code but It produces nothing (dbms_output does not return) :
DECLARE
doc xmldom.DOMDocument;
main_node xmldom.DOMNode;
root_node xmldom.DOMNode;
root_elmt xmldom.DOMElement;
transmissionHeaderNode xmldom.DOMNode;
transmissionHeaderElement xmldom.DOMElement;
item_node xmldom.DOMNode;
item_elmt xmldom.DOMElement;
item_text xmldom.DOMText;
buffer_problem CLOB;
BEGIN
doc := xmldom.newDOMDocument;
main_node := xmldom.makeNode(doc);
xmldom.setversion(doc,'1.0');
root_elmt := xmldom.createElement(doc, 'InvoiceTransmission');
root_node := xmldom.appendChild( main_node, xmldom.makeNode(root_elmt));
transmissionHeaderElement := xmldom.createElement(doc, 'TransmissionHeader');
transmissionHeaderNode := xmldom.appendChild(root_node, xmldom.makeNode(transmissionHeaderElement));
item_elmt := xmldom.createElement(doc, 'TransmissionDateTime');
item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
item_text := xmldom.createTextNode(doc, TO_CHAR(SYSDATE,'DD-MM-YYYY'));
item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
item_elmt := xmldom.createElement(doc, 'IssuingOrganiszationID');
item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
item_text := xmldom.createTextNode(doc,'0258');
item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
item_elmt := xmldom.createElement(doc, 'Version');
item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
xmldom.writetobuffer(doc, buffer_problem);
dbms_output.put_line(buffer_problem);
xmldom.freeDocument(doc);
END;
That's strange because when remove a code part like :
item_elmt := xmldom.createElement(doc, 'Version');
item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
I can get the ouput xml :
<?xml version="1.0"?>
<InvoiceTransmission>
<TransmissionHeader>
<TransmissionDateTime>26-10-2010</TransmissionDateTime>
<IssuingOrganiszationID>0258</IssuingOrganiszationID>
</TransmissionHeader>
</InvoiceTransmission>
I don't if it's a problem with xmldom or with dbms_output package...
Please someone can help me ?Works fine for me
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
SQL> set serveroutput on;
SQL>
SQL> DECLARE
2 doc xmldom.DOMDocument;
3 main_node xmldom.DOMNode;
4 root_node xmldom.DOMNode;
5 root_elmt xmldom.DOMElement;
6
7 transmissionHeaderNode xmldom.DOMNode;
8 transmissionHeaderElement xmldom.DOMElement;
9 item_node xmldom.DOMNode;
10 item_elmt xmldom.DOMElement;
11 item_text xmldom.DOMText;
12
13 buffer_problem CLOB;
14
15 BEGIN
16
17 doc := xmldom.newDOMDocument;
18 main_node := xmldom.makeNode(doc);
19 xmldom.setversion(doc,'1.0');
20 root_elmt := xmldom.createElement(doc, 'InvoiceTransmission');
21 root_node := xmldom.appendChild( main_node, xmldom.makeNode(root_elmt));
22
23 transmissionHeaderElement := xmldom.createElement(doc, 'TransmissionHeader');
24 transmissionHeaderNode := xmldom.appendChild(root_node, xmldom.makeNode(transmissionHeaderElement));
25
26 item_elmt := xmldom.createElement(doc, 'TransmissionDateTime');
27 item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
28 item_text := xmldom.createTextNode(doc, TO_CHAR(SYSDATE,'DD-MM-YYYY'));
29 item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
30
31 item_elmt := xmldom.createElement(doc, 'IssuingOrganiszationID');
32 item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
33 item_text := xmldom.createTextNode(doc,'0258');
34 item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
35
36 item_elmt := xmldom.createElement(doc, 'Version');
37 item_node := xmldom.appendChild(transmissionHeaderNode, xmldom.makeNode(item_elmt));
38 item_text := xmldom.createTextNode(doc, 'IATA:ISXMLInvoiceV3.0');
39 item_node := xmldom.appendChild(item_node, xmldom.makeNode(item_text));
40
41 --buffer_problem := 'a'; -- added to initialize clob
42 xmldom.writetobuffer(doc, buffer_problem); -- change to writetoclob
43 dbms_output.put_line(buffer_problem);
44 xmldom.freeDocument(doc);
45
46 END;
47 /
<?xml version="1.0"?>
<InvoiceTransmission>
<TransmissionHeader>
<TransmissionDateTime>26-10-2010</TransmissionDateTime>
<IssuingOrganiszationID>0258</IssuingOrganiszationID>
<Version>IATA:ISXMLInvoiceV3.0</Version>
</TransmissionHeader>
</InvoiceTransmission>Suggestions:
- Use dbms_xmldom instead of just xmldom. Oracle changed the name in the 9i days and xmldom is a synonym to dbms_xmldom.
- Use .writeToClob intead of .writeToBuffer
- I would suggest trying to upgrade to .4 as you pick up a lot of improvements and bug fixes. Whether what you are encountering is a bug I cannot say but would seem so.
- See the FAQ under your sign-in name to learn how to use the tag to format the code like I did above. -
Problem with update MUSE CC 2014.2 (october 6). after upgrading to the new version of Muse crashes very often (out without notice).
HELP! i can't get ANYTHING done in the new muse - keeps closing. once it crashes - i can't get the file back open!
i've lost all my work!
from my desktop - when it stared happening was with the updated version:
Logging in build 2014.2.1.10 started at: Mon Nov 03 13:36:38 2014
========================================
[00:00:42.416] Opening file '\\D-LAPTOP\_websites\dsbees muse\dsbees.muse' with status:success size:9797632 mod Date:Tue Sep 23 15:51:42 GMT-0500 2014 highestUID: 3548
[00:01:03.898] Preparing to Save As over "\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse" exists: true
[00:01:17.516] SaveAs complete for file '\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse' file size:9830400 mod Date:Mon Nov 3 13:37:51 GMT-0600 2014 highest UID:3551
Build 232: Mon Nov 3 19:41:03 2014 UTC: Error: CSI: OOBE: Serial Number: Error Code: O-10 Error Message: Unable to retrieve the serial number (Note: this may not be an error)
Build 232: Mon Nov 3 19:41:03 2014 UTC: Error: CSI: OOBE: Serial Number: Error Code: O-10 Error Message: Unable to retrieve the serial number (Note: this may not be an error)
Build 232: Mon Nov 3 19:41:07 2014 UTC: Error: CSI: OOBE: Serial Number: Error Code: O-10 Error Message: Unable to retrieve the serial number (Note: this may not be an error)
Build 232: Mon Nov 3 19:41:21 2014 UTC: Error: CSI: IMS: Connect: Error Code: I-200 Error Message: No Account
Build 232: Mon Nov 3 19:41:21 2014 UTC: Unknown IMS error 'SHARED_NOACCT_ERROR' has occurred when retrieving IMS token.
Build 232: Mon Nov 3 19:41:57 2014 UTC: Opening file '\\D-LAPTOP\_websites\dsbees muse\dsbees.muse' with status:This Adobe Muse site file requires a newer version of Adobe Muse. Please update to the latest version. size:9797632 mod Date:Tue Sep 23 15:51:42 GMT-0500 2014
Build 232: Mon Nov 3 19:41:57 2014 UTC: This Adobe Muse site file requires a newer version of Adobe Muse. Please update to the latest version.
Logging in build 2014.2.1.10 started at: Mon Nov 03 13:43:17 2014
========================================
[00:00:21.481] Opening file '\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse' with status:success size:9830400 mod Date:Mon Nov 3 13:37:51 GMT-0600 2014 highestUID: 3551
[00:00:30.373] AssertInDebug: Unable to run recovery. User file remains locked after 5 second pause.-assertInDebugOnly+DataBase/recover+MuseSite$/recover+MethodInfo-2886+DataBase$/run Recovery+apply+UIComponent/callLaterDispatcher2+UIComponent/callLaterDispatcher+end stack
[00:00:30.404] Failed to recover file:\\D-LAPTOP\_websites\dsbeesTWO\dsbeesTWO.muse
[00:00:30.420] Calling openConnection for file that doesn't exist? C:\Users\Owner\AppData\Roaming\com.adobe.AdobeMuseCC.2014.2\Local Store\Recovery\JXRoDn335LE0UosOdoStnQ Parent folder exists.
[00:00:34.429] open of SQL connection failed for C:\Users\Owner\AppData\Roaming\com.adobe.AdobeMuseCC.2014.2\Local Store\Recovery\JXRoDn335LE0UosOdoStnQ
[00:00:34.429] Failed to open mini-save connection B "C:\Users\Owner\AppData\Roaming\com.adobe.AdobeMuseCC.2014.2\Local Store\Recovery\JXRoDn335LE0UosOdoStnQ" Doesn't exist. Folder exists. error:SQLError: 'Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'
[00:00:34.429] EXCEPTION:[SQLC/internalOpen] SQLError: 'Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001'-SQLConnection/internalOpen+SQLConnection/open+DataBaseConnectionWrapper/o penConnection+MethodInfo-28954+EventDispatcher/dispatchEventFunction+EventDispatcher/dispa tchEvent+MethodInfo-28938+end stack
[00:00:34.445] AlertAndExit because of: [SQLC/internalOpen] SQLError: 'Error #3125: Unable to open the database file.', details:'Connection closed.', operation:'open', detailID:'1001' -
Problem with reading data over dblink
Hi,
I have a dblink from Oracle 10.2.0.3 db(on windows) to Postgresql 8.3.3 (on centos 4) .
When trying reading data from Postgresql table , I cannot read varchar colums, in he result set there is no error message.
In the hs trace file it says "unrecognized data type" for the varchar colums.
I tried character,text data types, but the error message is the same.
With Oracle 9.2.0.8 ( on hp/ux platform) there is no problem reading that data types.
How can I handle this problem?
ThanksHi,
i had a similiar problem with 10.2.0.3 querying MS/SQL2000 and Oracle support told me it is a bug which was fixed in 10.2.0.4, however, i couldn't upgrade as SAP was not certified with this version so i had configured a workarround with Oracle support:
create a DB link from 10.2.0.3 to a 9.2.0.8 DB, in the 9.2.0.8 i have created synonyms through DB link (HS) to the MS/SQL and it solved the problem.
i know it is not a best solution but it works and production system continue to function.
dBarak. -
Problem with sequences after import
We recently imported some table data from QA to DEV and now the DEV database has issues with sequences errors. How can I resolve the problem with sequences since we have constraint violation errors as a result of the table sequences being out of sync after the import of several schema tables.
We run a script like the following to get the sequences as close as possible after importing from PROD to DEV:
set serveroutput on;
DECLARE
CURSOR CUR IS
SELECT otherdb_seq.sequence_owner AS owner,
otherdb_seq.sequence_name AS seq_nm,
TO_CHAR(otherdb_seq.last_number) AS start_nr
FROM dba_sequences currdb_seq,
dba_sequences@prod otherdb_seq
WHERE currdb_seq.sequence_owner IN ('~schemaname~') AND
currdb_seq.sequence_owner = otherdb_seq.sequence_owner AND
currdb_seq.SEQUENCE_NAME = otherdb_seq.sequence_name
ORDER BY 1, 2;
sql_string VARCHAR2(500);
BEGIN
FOR REC IN CUR
LOOP
sql_string := 'DROP SEQUENCE '||REC.owner||'.'||REC.seq_nm;
DBMS_OUTPUT.PUT_LINE(sql_string||';');
EXECUTE IMMEDIATE sql_string;
sql_string := 'CREATE SEQUENCE '||REC.owner||'.'||REC.seq_nm;
sql_string := sql_string ||' START WITH '||REC.start_nr;
sql_string := sql_string ||' MAXVALUE 999999999999999999999999999';
sql_string := sql_string ||' MINVALUE '||REC.start_nr;
sql_string := sql_string ||' NOCYCLE NOCACHE ORDER';
DBMS_OUTPUT.PUT_LINE(sql_string||';');
EXECUTE IMMEDIATE sql_string;
sql_string := 'DROP PUBLIC SYNONYM '||REC.seq_nm;
DBMS_OUTPUT.PUT_LINE(sql_string||';');
EXECUTE IMMEDIATE sql_string;
sql_string := 'CREATE PUBLIC SYNONYM '||REC.seq_nm||' FOR '||REC.owner||'.'||REC.seq_nm;
DBMS_OUTPUT.PUT_LINE(sql_string||';');
EXECUTE IMMEDIATE sql_string;
sql_string := 'GRANT SELECT ON '||REC.owner||'.'||REC.seq_nm||' TO PUBLIC';
DBMS_OUTPUT.PUT_LINE(sql_string||';');
EXECUTE IMMEDIATE sql_string;
END LOOP;
END; -
Hi
I once tried using views in ClipBoard
It worked
However now Views don't seem to be working at ll
In the sense , it permits to insert a row but not the BLOB or image data into the table thru the view
Well, the details are as follows
Table CONTENT
id number(10) PK
content OrdSys.OrdImage
View CONTENTVIEW
select * from CONTENT;
Now I use this view for uploading the documents thru Clipboard
It permits to insert a row but not upload the document itself
The error is
"table not found"
I tried having the table as well as the view in the same schema, it still does not work
Any solutions please
nandeepWell, Mizuno
Thank you once again.
i recollect that you had warned me .
I have a problem here.
We have around 10 content managers
And each need to have his own login name and password.
Haveing seperate schemas does not seem to work out.
Any solutions
Also security is a problem
One more thing is that we wanted to have a history table which will store even the versions of the content.
Do database triggers work with OrdImage type or the BLOB datatypes?
Or will they give some problems?
Or is there a better approach for this problem
Even synonyms do not work in ClipBoard by the way.
It is only the table and nothing but the table
Thank you
nandeep -
Problems with some fonts, need help!
Hi everyone,
Recently I need to create some documents in Pages and I found some problems with some of the fonts. Apparently some fonts when the font size is increased the spacing between characters gets reduced and ooks very weird.
http://img109.imageshack.us/i/screencapturem.png/
I've tried all type of configs in pages and i'm really clueless what this is.
Can anyone please give me some pointers?
Thank you in advanced,
PrismerThis leaves several files instaled. Among them are the preferences files. If you re-install with existing preferences files, these one aren't replaced by new, clean, ones.
Right, uninstalling the application does not necessarily uninstall its preferences. (Indeed, previous InDesign and QuarkXPress betas had the problem that they preserved the older preferences when the newer betas were installed which could lead to crashes.)
Arguably, system software has to have smart install / uninstall so that all the files installed by an application are removed, but then what about fonts and / or profiles installed with the application, which some other application may be using as a resource.
I don't know, but the word 'simple' and the word 'software' don't seem ever to be synonyms .
/hh -
I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
Thank you in advance,
LeftyThis was one solution from the socket programming forum, have you tried this??
public Thread MyThread extends Thread{
boolean active = true;
public void run(){
ss.setSoTimeout(90);
while (active){
try{
serverSocket = ss.accept();
catch (SocketTimeoutException ste){
// do nothing
// interrupt thread
public void deactivate(){
active = false;
// you gotta sleep for a time longer than the
// accept() timeout to make sure that timeout is finished.
try{
sleep(91);
}catch (InterruptedException ie){
interrupt();
} -
Problem with Threads and a static variable
I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
Code functionality:
A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
The problem as far I understand is:
Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
Thanks,
B.D.
Code:
private static volatile boolean bChanged = false;
private static Thread objMainProcess;
protected static void Init(){
objMainProcess = new Thread() {
public void run() {
while( objMainProcess == Thread.currentThread() ) {
GetState();
objMainProcess.setDaemon( true );
objMainProcess.start();
public static void initStatusTimer(){
if(objTimer == null)
objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
public void actionPerformed( java.awt.event.ActionEvent evt){
SetState();
private static void SetState(){
if( objMainProcess == null ) return;
synchronized( objMainProcess ) {
bChanged = true;
try{
objMainProcess.notify();
}catch( IllegalMonitorStateException e ) {}
private static boolean GetState() {
if( objMainProcess == null ) return false;
synchronized( objMainProcess ) {
if( bChanged) {
SendMessage();
bChanged = false;
return true;
try {
objMainProcess.wait();
}catch( InterruptedException e ) {}
return false;
}Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
Again as you said, There is a reason I can't call sendMessage() inside setState().
The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
Thanks,
B.D.
Maybe you are looking for
-
Check list for upgrading from 10g to 11g when there is a schema replication
Hi We are looking to upgrade one of our production database from 10g to 11g Currently this database has one schema that is replicated to 2 other databases using Oracle streams. The replication is excluing DDLs and excluding several other application
-
since I updated my software to the IOS 7.0.4 I am unable to use any WIFI network i cannot connect to my home wifi network I am unable to do any backups. I have backed up my phone onto my Itunes account on my computer and I reset my phone...this did
-
Don't have correct permissions to any drive other than the boot drive
I installed SL, and when it came time to enter in the user name, it said the name was already taken xxxx and so I entered yyyy. As an example. Now User yyyy has Read / Write permissions for everything on Drive 1, the boot drive, but ALL of the other
-
I have an iMac for work and I am leaving the company. How do I clear the computer so that my soon to be former company is unable to see my personal information Ie. - internet, contacts, etc...
-
I keep having to clear my cache in order to post a message or visit certain sites, why?
I have been using firefox for a long time and only in the last two weeks have I had this issue. I visit Stuckincustoms.com daily but now i have to clear the cache or the site wont load. Also on 500px.com I have always posted replies about people pict