Search Results

Search found 7391 results on 296 pages for 'record locking'.

Page 149/296 | < Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >

  • xerces-c: Xml parsing multiple files

    - by user459811
    I'm atempting to learn xerces-c and was following this tutorial online. http://www.yolinux.com/TUTORIALS/XML-Xerces-C.html I was able to get the tutorial to compile and run through a memory checker (valgrind) with no problems however when I made alterations to the program slightly, the memory checker returned some potential leak bytes. I only added a few extra lines to main to allow the program to read two files instead of one. int main() { string configFile="sample.xml"; // stat file. Get ambigious segfault otherwise. GetConfig appConfig; appConfig.readConfigFile(configFile); cout << "Application option A=" << appConfig.getOptionA() << endl; cout << "Application option B=" << appConfig.getOptionB() << endl; // Added code configFile = "sample1.xml"; appConfig.readConfigFile(configFile); cout << "Application option A=" << appConfig.getOptionA() << endl; cout << "Application option B=" << appConfig.getOptionB() << endl; return 0; } I was wondering why is it when I added the extra lines of code to read in another xml file, it would result in the following output? ==776== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info ==776== Command: ./a.out ==776== Application option A=10 Application option B=24 Application option A=30 Application option B=40 ==776== ==776== HEAP SUMMARY: ==776== in use at exit: 6 bytes in 2 blocks ==776== total heap usage: 4,031 allocs, 4,029 frees, 1,092,045 bytes allocated ==776== ==776== 3 bytes in 1 blocks are definitely lost in loss record 1 of 2 ==776== at 0x4C28B8C: operator new(unsigned long) (vg_replace_malloc.c:261) ==776== by 0x5225E9B: xercesc_3_1::MemoryManagerImpl::allocate(unsigned long) (MemoryManagerImpl.cpp:40) ==776== by 0x53006C8: xercesc_3_1::IconvGNULCPTranscoder::transcode(unsigned short const*, xercesc_3_1::MemoryManager*) (IconvGNUTransService.cpp:751) ==776== by 0x4038E7: GetConfig::readConfigFile(std::string&) (in /home/bonniehan/workspace/test/a.out) ==776== by 0x403B13: main (in /home/bonniehan/workspace/test/a.out) ==776== ==776== 3 bytes in 1 blocks are definitely lost in loss record 2 of 2 ==776== at 0x4C28B8C: operator new(unsigned long) (vg_replace_malloc.c:261) ==776== by 0x5225E9B: xercesc_3_1::MemoryManagerImpl::allocate(unsigned long) (MemoryManagerImpl.cpp:40) ==776== by 0x53006C8: xercesc_3_1::IconvGNULCPTranscoder::transcode(unsigned short const*, xercesc_3_1::MemoryManager*) (IconvGNUTransService.cpp:751) ==776== by 0x40393F: GetConfig::readConfigFile(std::string&) (in /home/bonniehan/workspace/test/a.out) ==776== by 0x403B13: main (in /home/bonniehan/workspace/test/a.out) ==776== ==776== LEAK SUMMARY: ==776== definitely lost: 6 bytes in 2 blocks ==776== indirectly lost: 0 bytes in 0 blocks ==776== possibly lost: 0 bytes in 0 blocks ==776== still reachable: 0 bytes in 0 blocks ==776== suppressed: 0 bytes in 0 blocks ==776== ==776== For counts of detected and suppressed errors, rerun with: -v ==776== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)

    Read the article

  • Specify ApplicationName when using ASP.NET Web Site Administration Tool

    - by ProfK
    This tool is supposed to configure users and roles etc., but when I use it on a new web site, with a new aspnetdb database, it adds a record to the aspnet_Applications table with the ApplicationName and the LoweredApplicationName fields set to /. I think it would make more sense if it actually used the application name, i.e. the web site name. Can I safely just change the application name? Is there a better way of configuring these things?

    Read the article

  • Non-blocking MySQL updates with java?

    - by justkevin
    For a multiplayer game I'm working on I'd like to record events to the mysql database without blocking the game update thread so that if the database is busy or a table is locked the game doesn't stop running while it waits for a write. What's the best way to accomplish this? I'm using c3p0 to manage the database connection pool. My best idea so far is to add query update strings to a synchronized list with an independent thread checking the list every 100ms and executing the queries it finds there.

    Read the article

  • file upload with php

    - by Rajanikant shukla
    Hi every body I am uploading file with php every thing is fine but move_uploded_file is not working every variable displayed record and all permission for file is set function uploadfile($filename) { $filetype=$filename["type"]; $filename=$filename['name']; $filetempname=$filename['tmp_name']; if($filetype=="application/msword") { move_uploaded_file($filetempname,"resume/".$filename); } }

    Read the article

  • linq to sql with nservicebus table lock issue

    - by IGoor
    I am building a system using NServiceBus and my DataLayer is using Linq 2 SQL. The system is made up of 2 services. Service1 receives messages from NSB. It will query Table1 in my database and inserts a record into Table1 If a certain condition is met a new NSB message is sent to the 2nd service Service2 will update records also in Table1 when it receives messages from Service1 and it does some other non database related work. Service2 is a long running process. The problem I am having is the moment Service2 updates a record in Table1, the table is locked. The lock seems to be in place until Service2 has completed all it is processing. i.e. The lock is not released after my datacontext is disposed. This causes the query in Service1 to timeout. Once Service2 completes processing, Service1 resumes processing again without problem. So for example Service1 code may look like: int x =0; using (DataContext db = new DataContext()) { x = (from dp in db.Table1 select dp).Count(); // this line will timeout while service2 is processing Table1 t = new Table1(); t.Data = "test"; db.Table1.InsertOnSubmit(t); db.SubmitChanges(); } if(x % 50 == 0) CallService2(); The code in service2 may look like: using (DataContext db = new DataContext()) { Table1 t = db.Table1.Where(t => t.id == myId); t.Data = "updated"; db.SubmitChanges(); } // I would have expected the lock to have been released at this point, but this is not the case. DoSomeLongRunningTasks(); // lock will be released once service2 exits I don't understand why the lock is not released when the datacontext is disposed in Service2. To get around the problem I have been calling: db.ExecuteCommand("SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"); and this works, but I am not happy using it. I want to solve this problem properly. Has any one experienced this sort of problem before and does any one know how to solve it? Why is the lock not released after the datacontext has been disposed? Thanks in advance. p.s. sorry for the extremely long post.

    Read the article

  • Continuous Form, how to add/update records with external connection

    - by Mohgeroth
    EDIT After some more research I found that I cannot use a continuous form with an unbound form since it can only reference a single record at a time. Given that I've altered my question... I have a sample form that pulls out data to enter into a table as an intermediary. Initially the form is unbound and I open connections to two main recordsets. I set the listbox's recordset equal to one of them and the forms recordset equal to the other. The problem is that I cannot add records or update existing ones. Attempting to key into the fields does nothing almost as if the field was locked (Which it is not). Settings of the recordsets are OpenKeyset and LockPessimistic. Tables are not linked, they come from an outside access database seperate from this project and must remain that way. I am using an adodb connection to get the data. Could the separation of the data from the project be causing this? Sample Code from the Form Option Compare Database Option Explicit Private conn As CRobbers_Connections Private exception As CError_Trapping Private mClient_Translations As ADODB.Recordset Private mUnmatched_Clients As ADODB.Recordset Private mExcluded_Clients As ADODB.Recordset //Construction Private Sub Form_Open(Cancel As Integer) Set conn = New CRobbers_Connections Set exception = New CError_Trapping Set mClient_Translations = New ADODB.Recordset Set mUnmatched_Clients = New ADODB.Recordset Set mExcluded_Clients = New ADODB.Recordset mClient_Translations.Open "SELECT * FROM Client_Translation" _ , conn.RBRS_Conn, adOpenKeyset, adLockPessimistic mUnmatched_Clients.Open "SELECT DISTINCT(a.Client) as Client" _ & " FROM Master_Projections a " _ & " WHERE Client NOT IN ( " _ & " SELECT DISTINCT ClientID " _ & " FROM Client_Translation);" _ , conn.RBRS_Conn, adOpenKeyset, adLockPessimistic mExcluded_Clients.Open "SELECT * FROM Clients_Excluded" _ , conn.RBRS_Conn, adOpenKeyset, adLockPessimistic End Sub //Add new record to the client translations Private Sub cmdAddNew_Click() If lstUnconfirmed <> "" Then AddRecord End If End Sub Private Function AddRecord() With mClient_Translations .AddNew .Fields("ClientID") = Me.lstUnconfirmed .Fields("ClientAbbr") = Me.txtTmpShort .Fields("ClientName") = Me.txtTmpLong .Update End With UpdateRecords End Function Private Function UpdateRecords() Me.lstUnconfirmed.Requery End Function //Load events (After construction) Private Sub Form_Load() Set lstUnconfirmed.Recordset = mUnmatched_Clients //Link recordset into listbox Set Me.Recordset = mClient_Translations End Sub //Destruction method Private Sub Form_Close() Set conn = Nothing Set exception = Nothing Set lstUnconfirmed.Recordset = Nothing Set Me.Recordset = Nothing Set mUnmatched_Clients = Nothing Set mExcluded_Clients = Nothing Set mClient_Translations = Nothing End Sub

    Read the article

  • Detecting own posts on Facebook from a Chrome extension perspective

    - by Bane
    I want to create a Chrome extension that will automatically like every post I make on Facebook. My question is, how can I detect when I post something, and if that post if mine? Is there an event that occurs or something? (And just for the record, I know that these sorts of things are impossible when other apps post on my behalf, at least from an extension perspective. So I'm only concentrating on posts that I actually click the "post" button, or enter for, myself.)

    Read the article

  • Using linq select to provide a grid datasource, properties are read-only

    - by Kelly
    I am using the return from the following call as the datasource for a grid. public object GetPropertyDataSourceWithCheckBox( ) { return ( from p in LocalProperties join c in GetCities( ) on p.CityID equals c.CityID orderby p.StreetNumber select new { Selected = false, p.PropertyID, p.StreetNumber, p.StreetName, c.CityName } ).ToList( ); } I get a checkbox in the grid, but it is READ-ONLY. [For the record, the grid is DevExpress.] Is there a way around this, short of creating a non-anonymous class?

    Read the article

  • Insert data into SQL server with best performance

    - by Incognito
    I have an application which intensively uses DB (SQL Server). As it must have high performance I would like to know the fastest way to insert record into DB.Fastest from the standpoint of execution time. What should I use ? As I know the fastest way is to create stored procedure and to call it from code (ADO.NET). Please let me know is there any better way or may be there are is some other practices to increase performance.

    Read the article

  • LINQ entity query performance

    - by Abdel Olakara
    Hi all, I have a silly question. I would like to know if there is performance deference in these two quries: var cObject = from cust in entities.Customer where cust.id == cid select cust; and var cObject = entities.Customer.First( c=> c.id == cid); My query return only one record as I am querying with the primary key. But do they make any difference?

    Read the article

  • asp.net mvc user control problem foreach loop

    - by mazhar
    Previous post <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" % <% MvcApplication1.Models.FeaturesRepository _model = new MvcApplication1.Models.FeaturesRepository(); % <% foreach (var md in _model.GetAllFeatures()) { % <%--<% if (md.int_ParentId == 0) { %--% <%= md.vcr_FeaturesName % <%--<% } %--% <% } % It is with reference to the previous post above.Is there something wrong with the foreach loop(The result is correct but it is displaying the series of Add,Add,Add,Add,Add,Add...,which is the last record of the getallfeatures.

    Read the article

  • Giving GUID for data using NDBUnit

    - by jess
    I am using NDBUbit to load data from XML file.Right now,I am manually giving GUID for each record(our primary key for all tables is unique-identifier) in the xml file.But,I wonder if there is a better way to do this?

    Read the article

  • How wrong is it to modify the SDP body of a SIP message?

    - by rusbi
    A requirement for the SIP PBX I created for my company was to record all calls passing through it. I solved it by forcing all SIP message to pass through the PBX and to modify the SDP body so the stream passes through it and gets recorded. It works well. I recently found out that this is not allowed. Is there any other way to implement call recording and how "wrong" is this in regard to the protocol?

    Read the article

  • What sql server isolation level should I choose to prevent concurrent reads?

    - by Brian Bolton
    I have the following transaction: SQL inserts a 1 new record into a table called tbl_document SQL deletes all records matching a criteria in another table called tbl_attachment SQL inserts multiple records into the tbl_attachment Until this transaction finishes, I don't want others users to be aware of the (1) new records in tbl_document, (2) deleted records in tbl_attachment, and (3) modified records in tbl_attachment. Would Read Committed Isolation be the correct isolation level?

    Read the article

  • android error NoSuchElementException

    - by Alexander
    I have returned a cursor string but it contains a delimiter. The delimiter is . I have the string quest.setText(String.valueOf(c.getString(1)));I want to turn the into a new line. What is the best method to achieve this task in android. I understand there is a way to get the delimeter. I want this to achieved for each record. I can itterate through record like so. Cursor c = db.getContact(2); I tried using a string tokenizer but it doesnt seem to work. Here is the code for the tokenizer. I tested it in just plain java and it works without errors. String question = c.getString(1); // quest.setText(String.valueOf(c.getString(1))); //quest.setText(String.valueOf(question)); StringTokenizer st = new StringTokenizer(question,"<ENTER>"); //DisplayContact(c); // StringTokenizer st = new StringTokenizer(question, "=<ENTER>"); while(st.hasMoreTokens()) { String key = st.nextToken(); String val = st.nextToken(); System.out.println(key + "\n" + val); } I then tried running it in android. Here is the error log 06-06 22:31:55.251: E/AndroidRuntime(537): FATAL EXCEPTION: main 06-06 22:31:55.251: E/AndroidRuntime(537): java.util.NoSuchElementException 06-06 22:31:55.251: E/AndroidRuntime(537): at java.util.StringTokenizer.nextToken(StringTokenizer.java:208) 06-06 22:31:55.251: E/AndroidRuntime(537): at alex.android.test.database.quiz.TestdatabasequizActivity$1.onClick(TestdatabasequizActivity.java:95) 06-06 22:31:55.251: E/AndroidRuntime(537): at android.view.View.performClick(View.java:3511) 06-06 22:31:55.251: E/AndroidRuntime(537): at android.view.View$PerformClick.run(View.java:14105) 06-06 22:31:55.251: E/AndroidRuntime(537): at android.os.Handler.handleCallback(Handler.java:605) 06-06 22:31:55.251: E/AndroidRuntime(537): at android.os.Handler.dispatchMessage(Handler.java:92) 06-06 22:31:55.251: E/AndroidRuntime(537): at android.os.Looper.loop(Looper.java:137) 06-06 22:31:55.251: E/AndroidRuntime(537): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-06 22:31:55.251: E/AndroidRuntime(537): at java.lang.reflect.Method.invokeNative(Native Method) 06-06 22:31:55.251: E/AndroidRuntime(537): at java.lang.reflect.Method.invoke(Method.java:511) 06-06 22:31:55.251: E/AndroidRuntime(537): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-06 22:31:55.251: E/AndroidRuntime(537): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-06 22:31:55.251: E/AndroidRuntime(537): at dalvik.system.NativeStart.main(Native Method) This is the database query public Cursor getContact(long rowId) throws SQLException { Cursor mCursor = db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, question, possibleAnsOne,possibleAnsTwo, possibleAnsThree,realQuestion,UR}, KEY_ROWID + "=" + rowId, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); }

    Read the article

  • load domain specific content

    - by wayne
    Let's say I have an app sitting at myapp.com The app has clients or users that are situated here myapp.com/jonny myapp.com/sally I want to allow users to point their own domain to my server (A record) and load their specific content. No redirects or anything. jonnysapp.com -> myapp.com/jonny So somehow my server needs to detect where the request is coming from and set the client... correct?

    Read the article

  • how to insert an integer value from a Grid to Sql table?

    - by z-chaos
    Hi, I have a AdvWebGrid where the 7th coloumn is DynEdit where user will enter the value.Now I have to take the enetered value and insert into the Sql tablel. For example i have 7 records in the grid the user will enter some comments for the first three record and save.Now i have to insert/update the first three comments in the table.

    Read the article

< Previous Page | 145 146 147 148 149 150 151 152 153 154 155 156  | Next Page >