Sitemap

Amicuk Programming Answers

Changes commited to the database only after I update OracledataAdapter twice

-0001-11-30   Views:0

Advertisement

Hi. I am using oracledataadapter to manage the data which is eventually displayed in winform datagridview (Visual Studio 2012) everything works fine , but I have to click "Save" buttin twice to see the changes in the database (Oracle express 11g

Hi. I am using oracledataadapter to manage the data which is eventually displayed in winform datagridview (Visual Studio 2012)
everything works fine , but I have to click "Save" buttin twice to see the changes in the database (Oracle express 11g)
Can you please advice....
Here is my code
it is very simple
1. Obtain connection
2. Create dataadapter
3. Create commands
4. Fill the datatable and dataset
public partial class Concordance : Form
        OracleDataAdapter setupAdapter;
        DataSet projDataset;
        OracleConnection conn;
        //binding sources
        BindingSource setupBindingSource = new BindingSource();
        DataTable setupTable;
        public Concordance()
            InitializeComponent();
            //load tables
            loadSetup();
        //setup table
        private void loadSetup()
            string oradb = ConfigurationManager.ConnectionStrings["OpenU"].ConnectionString;
            conn = new OracleConnection(oradb);
            try
               // using (conn = new OracleConnection(oradb))
                setupAdapter = new OracleDataAdapter("select * from ou_setup", conn);
                    OracleCommandBuilder builder = new OracleCommandBuilder(setupAdapter);
                    projDataset = new DataSet("Concordia");
                    setupTable = new DataTable("Setup");
                    projDataset.Tables.Add(setupTable);
                    setupAdapter.Fill(projDataset,"Setup");
                    //bind the gataGridView
                    this.setupGrid.DataSource = projDataset.Tables["Setup"];
                    this.setupBindingSource.DataSource = projDataset.Tables["Setup"];
                    this.setupNavigator.BindingSource = this.setupBindingSource;
            catch (Exception ex)
                string error = ex.Message;
                MessageBox.Show(error);
        private void saveSetupBtn_Click(object sender, EventArgs e)
           // only after sabe button clicked for the second time the changes are commited into the database
            this.setupAdapter.Update(projDataset.Tables["Setup"]);
            MessageBox.Show("saved");

The replay answer
Advertisement
How are you reading in the object initially? The problem is likely that you are modifying an object from the session cache. When you then read in the object from the uow, it uses the object in the session cache as the back up. So there will not appear to be any changes to persist to the database.
You will need to make a copy of the object for modification, or use the copy from the unitofwork to make the changes instead of working directly on the object in the session. Disabling the cache means there is no copy in the session cache to use as a back up, so the uow read has to build an object from the database.
Best Regards,
Chris

Go to See the other 3 answers

Changes commited to the database only after I update OracledataAdapter twice

Category:DefaultRelease time:-0001-11-30Views:130

Hi. I am using oracledataadapter to manage the data which is eventually displayed in winform datagridview (Visual Studio 2012) everything works fine , but I have to click "Save" buttin twice to see the changes in the database (Oracle express 11g[More]

Why is my  CLEAR_BLOCK(no_validate) not committing to the database?

Category:DefaultRelease time:2015-10-11Views:130

What I need is when the alert button 1 is selected fo to the detail block(ADM) and just delete everything for the current master id. When I click on the button it deletes for a split second and all the data comes back.Quite confused.. IF Id_Null(al_i[More]

TopLink cached object changed are not commited to the database

Category:DefaultRelease time:2015-10-11Views:130

Hello, I'm using TopLink 10 and I have a writing issue with a use case: 1. I read an obect using TopLink that is in the IdentityMap 2. Using JSF this object is edited throught a web form. 3. I give the modified object to the data layer and try to mod[More]

Getting only the rows committed in the database

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have one strange requirement in my application. I need to fetch the rows from a particular table in the database which are committed. I mean there are other view objects for that table and those view objects are manipulating the data in that ta[More]

I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update with 1.

Category:DefaultRelease time:2015-10-11Views:130

I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update wit[More]

File-to-rfc ..database tables are not updating??

Category:DefaultRelease time:2015-10-11Views:130

hi xi friends.. in my file -to-rfc scenario.. without BPM .. in sxmb_moni..it is showing successfull.. database tables in sap not updating.. my source structure.. workorders 1..1 ..order 1..unbounded ...id ...operation 1..unbounded .....id .....closi[More]

How to lock a database Z table before updating it through a report program

Category:DefaultRelease time:-0001-11-30Views:130

Hi, How to lock a database Z table before updating it through a report program and also how to unlock it after my updation. The whole process is done through report program.Hi, Go to SE11, in the option 'Lock object' enter the name of your lock, begi[More]

Database history growth not updating after EHP upgrade

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, We are using SAP ECC 6.0 (731 - SP09 )  & DB2 Fix pack 5 version.Database history growth not updating after EHP upgrade. I have check  collector job running fin and DB tab > Configuration > Data Collection Framework > Configuration Co[More]

How i can enter information from Database to jtree and update it

Category:DefaultRelease time:-0001-11-30Views:130

How i can enter information from Database to jtree and update itIs the memory cache enabled (about:cache)?<br /> You can open about: pages via the location bar like you open a website. *http://kb.mozillazine.org/browser.cache.memory.enableRead other[More]

Database that can automatically update ebooks w/embedded flash

Category:DefaultRelease time:-0001-11-30Views:130

Hi I have a client who thinks it's possible to set up a database that will automatically update ebooks/pdf files with embedded flash so that manual translation between languages (e.g. english/norwegian/german/russian) can be avoided.  I'm trying to e[More]

Trigger changes are not committing to the database

Category:DefaultRelease time:2015-10-11Views:130

I have 9iAS and 9i DB both on my laptop. I am having a problem in which a trigger run off a WHEN_BUTTON_PRESSED function is not committing the changes to the database. In the trigger I have: 1 record insert into table A. 1 record update to table B. 1[More]

Hot
Hello Experts, Myself Pranay. I am working in AFS industry. I created an info record in PB00 which is for standard material. but when i am doing carry out new price in PO, price is coming in both PB00 & J3AP. J3AP is for grid material. Please suggest [More]
This problem just started a few days ago. Up until then, I was using iTunes with no problems. I have a Dell Dimension 3000 running Windows XP. (Yes, I know I need to upgrade, but the program was running fine until just recently.) There were no system [More]
Hi Gurus, I have 1000 Open Sales order to update revised price (Sales Orders created with backdated ). I have updated all Sales Orders pricing date with revised pricing date(using MASS tcode MASSSDHEAD_S-PRSDT) and all Sales orders revised pricing da [More]
I have been frequently running into an issue that iOS mail can't get e-mail.  I get the error "Cannot Get Mail, the user name or password for Gmail is incorrect"  I can delete the account and set it up again in settings and have no problem but t [More]
I have a 2GB Nano. The display says "Use iTunes to restore" then underneath it has text in other languages. I plug the ipod in and itunes doesn't recognize it...nor does it show up in "My Computer". When I plug the ipod in, the display [More]
I can't wrap my mind around the fact that Skype either doesn't give a **bleep** or is literally not able to fix the blurry profile picture bug that haunts Skype for almost a year now. How HARD can it be to fix it? For months and months me and other p [More]
Hello, I m new to this forum, I ve been reading through prior posts to see if anyone has a solution to my problem but none so far. I ve had a failure to boot in Win XP yesterday (single OS on my system), where I get the Toshiba screen, then nothing - [More]
I just started having this problem yesterday. iTunes will burn an mp3 cd just fine; however, when I try to burn an audio cd it says that there are too many songs to fit on one disc and there is only like ten 4 minute songs. Then I click to make multi [More]
Hello, The Agent event detail box in the Agent Distribution tab of the Call Manager peripheral of the PG Explorer in ICM is not enabled. I remember being told during installation that if checked it unnecessarily increase CPU usage. With the Agent eve [More]
Hello ALL We are trying  to configure the queue parameters for <i>initial indexing</i> and <i>Daily update of index</i> . We are not able to see the <i>Initial Indexing Mode</i> parameter and for that we can set it up : [More]