Forgot your password?
Sign in with
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Python questions
View C++ questions
View Java questions
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Design and Architecture
Internet of Things
C / C++ / MFC
ATL / WTL / STL
Objective-C and Swift
Hardware & Devices
Hosting and Servers
.NET (Core and Framework)
Site Bugs / Suggestions
Spam and Abuse Watch
The Insider Newsletter
The Daily Build Newsletter
Most Valuable Professionals
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Comments by Teamsar Muliadi (Top 39 by date)
Emmm.. Okay.. i will share about about my application as your information..
In my app i have 2 timers, Timer A and Timer B.
Periodically Timer A will check an signal like semaphore concept i think, if that signal is true or false. If true, a job like loading data from database (about 100 messages) will be processed until finished (signal = false).
These output will be inserted to table first, and then Timer B will do a job like sending ack messages to client per 1.5 seconds.
The main problem is, number of output (total ack) is not same with incoming in the output table whereas my application (console) doesn't processing it again (keep in mind that my app is still running, because of theses timers).
You can try this one :
public void DoInsertDataIncomingMsg(object sender)
OracleConnection objCon = new OracleConnection(CReaderConfig.StructureAppSettings.connStringAkses);
oTransc = objCon.BeginTransaction(IsolationLevel.Unspecified);
//oTransc.IsolationLevel = IsolationLevel.ReadCommitted;
oCommand = objCon.CreateCommand();
oCommand.Transaction = oTransc;
if (oCommand.Transaction == null)
log.Debug("Transaction 1 is null");
oCommand.CommandText = CQuery.Q_INSERT_INTO_T_INCOMING_MSGS(((CCommonStruct)sender).incoming_date,
byte newvalue = System.Text.Encoding.Unicode.GetBytes(((CCommonStruct)sender).get_clob_messages);
log.Debug("New value : " + System.Text.Encoding.Unicode.GetString(newvalue));
log.Debug("Reference ID : " + ((CCommonStruct)sender).getReferenceID);
oCommand.CommandText = CQuery.Q_UPDATE_T_INCOMING_MSGS(((CCommonStruct)sender).getReferenceID);
if (oCommand.Transaction == null)
log.Debug("Transaction 2 is null");
using (OracleDataReader reader = oCommand.ExecuteReader())
global::System.Data.OracleClient.OracleLob clob = reader.GetOracleLob(0);
clob.Write(newvalue, 0, newvalue.Length);
catch (Exception ex)
log.Debug("Error while executing DoInsertDataIncomingMsg for Reference ID : " + ((CCommonStruct)sender).getReferenceID, ex);
if (objCon != null)
Mmm.. after i read the link (msdn) above, i have a question for you. How about destructor if we don't have constructor ?? Thanks :)
It means that if we want to implement IDisposable interface, the class(es) must have constructor, doesn't it ?
(after i read your links).
Hey... it works... :) thanks for giving me solution.. :)
Is there anybody can help me..??
thank you cmanderson.. :)
Is anybody can help me please.. :(
Anybody can help me please..?? :(
This is the big problem i think... I have spent 2 days of my time for this problem.. but there is no result..
It doesn't work buddy.. :(
Hehehe.. sorry.. if "padleft" in my description is meaningless or has no a meaning.. :)
The point of my question is, is there any "built in" function to handle the format.. thank you.. :)
Mmm.. ok.. but how to get BankID, ExtRef, SeqNum.. if i have splited this string.. and the result like this :
NB : Length of each other is different.. and we don't know about its length (BankID, ExtRef, SeqNum.. etc)
ok.. you have just made some thread.. But, how do you implement these threads if you have some message to be processed by these threads ??? :confuse:
* sample of xml :
* <record name="TotalThread">
* <field name="total">5
private int GET_NUMBER_OF_THREAD()
int total_thread = 0;
XmlTextReader obj = new XmlTextReader();
string flag = obj.GetAttribute("name");
if(flag == "total")
total_thread = obj.Value;
Sorry.. if my english is so bad... so you can't exactly sure what i mean.. :(
Yes.. i know how to make a thrad, read an xml file, and use a for loop. But, how to implement this problem.. i'm really2 blank.. what is the main point to start first.. may you help me to give me an example please.. ?? :(
Thank you helmy. :)
Is there any other difference between these collections, i mean IDictionary is more faster than hashtable.. ??
Mmmm... why did you say not to use ArrayList ?? Give me your reason, please.. :) so i can believe, that i should not use array list. And in my project, no matter how much memory will be used.. i want my application more faster than before. May you advice me, which one is the best for this situation..??
Ok.. :) thank you aspdotnetdev.. :)
Mmmm... i see.. :), but.. according to you.. which one is the best practice from these cases above ??
Mmm.. but, how about in the first case ??
Btw, what is the difference between "asynchronous thread" and "not asynchronous" guru..?? And how about "Thread Join" ?? would u tell me..??
Mmm.. ok.. :) thank you guru.. :)
Hhhmm... i see.. :) but, how about "peformance" and "bottleneck" guru ??
DEFINITELY faster ?? wooww.. That sound seems good.. :) Mmm.. ok.. i will try as u tell me.. Thank you. :)
ExecuteScalarQuery is a method that return an object as value.
Mmm.. are u sure it is more faster than my trick in convert an object to int expert :confuse: ??
Mmm.. i think so.. :( My basic in programming is not good enough... :( I will try to start learning. Thank you.
Thank you for your explanation Al-Farooque.. :)
Mmmmm.. it means that i have made "coupling".. is it right..?? Do u have some best practice for this problem..?? :) Thanks
Hhmmm... i'm not sure about your opinion expert.. :( Sorry.. :(
You should have given the best way based on your best practice, not based on my problem.
I'm afraid I'll miss some of the data if I use this way, coz' my project will process much data.. so i must implement the best way... Thank you expert.. :)
Is this accessor consume much memory ?? :( and based on your answer, we must make our variables private, it means that, i should have made 'each class would have their own set of variables'.. right??
If it's right, i have one question for u expert.. hehehehe.. :)
The many variables that we make, the more memory consumed.. is it right..??
Thank you Mohammad :)
Thank u.. :)
Hehehehe... you have just made a joke.. :D It's need much time to read one by one the article.. :) Would u make a simple sample for guiding me a good programming in struct based on my problmem ?.. hehehe.. :) Thank u.
Mmm.. yup, i have known about it.. To make an autoincrement, we must create a sequence and then make a trigger for it.. :)
My question is how to reset the autoincrement.. and then you have just said update the sequence.. but i don't know how to do that.. would u like to help me, how to do that expert ??
Thank you Prakash Kalakoti :), this code is very helpful for me.. :)
Reason for my vote of 5
This code is helpful for me.
ParameterizedThreadStart has a method void(obj). If i use this code :
oThread1 = new Thread (new ParameterizedThreadStart(SendAckDetail));
There are many errors occur.. :(
Last Updated 1 Jan 1900
All Rights Reserved.