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
dear sap basis gurus, i am currently having problems signing on to our DEV server. i get this error message: <SID>: SAP System Message Syntx error or generation error in a screen. it won't let me log on. there were no changes made on the server (i.e [More]
I recently installed a firmware upgrade on my E3000 to firmware version 1.0.04.build 6.  Since the upgrade I am unable to see any of my files on my network computer which is running windows 7.  Before everything was fine and I could stream to my dvd [More]
Hello All I have a problem with what appears to be static electricity induced noise on thermocouples. We are testing with a sand like medium flowing across a plexiglass window and measuring temperature in the flow. The interaction of the air/sand mix [More]
I have an application that prints a series of documents to pdf. In the pdf printing preferences sheet I have selected an output directory. Unfortunately each subsequent pdf overwrites the previous one. Is there any way to have Acrobat create a new fi [More]
Hi, I have two Macs on a local network. I am sharing a folder on Mac-A and would like users to have read-only access to it. It is important that users cannot modify the data in this folder. On Mac-A: Selecting System Preferences->Sharing->File Shari [More]
I connected a WesternDigital 1TB USB 2.0 hard drive to my WRT160NL's USB port; and connected my PC to the WRT160NL via Ethernet cable. I can detect and configure the hard drive without any problem. But the read/write speed to the USB disk is very slo [More]
I want to delete half of the columns of a table...or perhaps a 1/4 of it. Is there any way to do this in oracle 8i?You can also have Oracle pick rows randomly, i.e. SELECT *   FROM <<someTable>> SAMPLE( 10 )will return approximately 10% of the [More]
Here's my example: I have a Spin Play subscription and love it, so I figured I'd look what other magazines had Ipad versions. I didn't want to limit it to just ones I could think of, so I searched the App Store for "magazine," which obviously br [More]
hi all Im trying to install application server 10.1.2.02 on windows 7 , but it cant start even the first step of the installation Im new in oracle applicatin server issue so can you please help me and tell me what to do which release to install and f [More]
New to the site and I'm wondering if anyone could give me a little assistance! I have jpegs of a LOT of fabric swatches that are to be inserted into a PSD file of a living room as the window blinds and this needs to be achieved via an Action. The way [More]