Search Results

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

Page 95/296 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • select only new row in oracle

    - by Hlex
    Hi, I have table with "varchar2" as primary key. Transaction is about 1 000 000 per day. my app wake up every 5 minute to generate text file by query only new record. It will remember last point and do only new record. 1)Do you have idea how query with good performance? I able to add new column if need. 2)what do you think this process should do by? plsql? java?

    Read the article

  • What is wrong with mysql query?

    - by bala3569
    I use the following mysql query, DELIMITER $$ DROP PROCEDURE IF EXISTS `allied`.`aboutus_delete`$$ CREATE DEFINER=`allied`@`%` PROCEDURE `aboutus_delete`( IN p_Id int(11) ) BEGIN if exists(select aboutUsId from aboutus where aboutUsId=p_id and isDeleted=0) update aboutus set isDeleted=1 where aboutUsId=p_id else select 'No record to delete' END$$ DELIMITER ; But i get this error when i execute it... Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update aboutus set isDeleted=1 where aboutUsId=p_id else select 'No record to' at line 6

    Read the article

  • Tail recursion in Erlang

    - by dagda1
    Hi, I am really struggling to understand tail recursion in Erlang. I have the following eunit test: db_write_many_test() -> Db = db:new(), Db1 = db:write(francesco, london, Db), Db2 = db:write(lelle, stockholm, Db1), ?assertEqual([{lelle, stockholm},{francesco, london}], Db2). And here is my implementation: -module(db) . -include_lib("eunit/include/eunit.hrl"). -export([new/0,write/3]). new() -> []. write(Key, Value, Database) -> Record = {Key, Value}, [Record|append(Database)]. append([H|T]) -> [H|append(T)]; append([]) -> []. Is my implementation tail recursive and if not, how can I make it so? Thanks in advance

    Read the article

  • How to get use text columns in a trigger

    - by Jeremy
    I am trying to use an update trigger in sql 2000 so that when an update occurs, I insert a row into a history table, so I retain all history on a table: CREATE Trigger trUpdate_MyTable ON MyTable FOR UPDATE AS INSERT INTO [MyTableHistory] ( [AuditType] ,[MyTable_ID] ,[Inserted] ,[LastUpdated] ,[LastUpdatedBy] ,[Vendor_ID] ,[FromLocation] ,[FromUnit] ,[FromAddress] ,[FromCity] ,[FromProvince] ,[FromContactNumber] ,[Comment]) SELECT [AuditType] = 'U', D.* FROM deleted D JOIN inserted I ON I.[ID] = D.[ID] GO Of course, I get an error "Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables." I tried joining to MyTable instead of deleted, but because the insert triger fires after the insert, it ends up inserting the new record into the history table, when I want the original record. How can I do this and still use text columns?

    Read the article

  • mysql way to make a lock in a php page

    - by Cris
    Hello, i have the following mysql table: myTable: id int auto_increment voucher int not null id_user int null I've populated voucher field with values from 1 to 100000 so i've got 100000 records; when a user clicks a button in a PHP page, i need to allocate a record for the user so i make something similar like: update myTable set id_user=XXX where voucher=(SELECT * FROM (SELECT MIN(voucher) FROM myTable WHERE id_user is null) v); The problem is that I don't use locks and i should use them because if two users click in the same moment i risk to assign the same voucher to different persons (2 updates in the same record so i lose 1 user) ... I think there must be a correct way to do this, can you help me please? Thanks ! cris

    Read the article

  • Stop a postback in javascript

    - by jmpena
    hello, i have an ASP webform with a JQuery Thickbox, i have an image that opens the thickbox when user click. once open the thickbox it shows me a grid with several rows and a button to select one and after the user select the record it returns to the main page the recordselected and cause a __doPostBack() BUT! sometimes in IE6 it stay loading the postback and never ends i have to refresh the page and when it refresh it shows everything fine. but i dont want the postback stay loading AND it does not happend always. i have to call a __doPostBack because i need to find info related to the selected record. thanks.

    Read the article

  • capturing dns packets using java

    - by rgksugan
    I want to log the websites visited in a system. So i decided to record the packets send by the system. I am using Jpcap API. I am able to record a lot of packets. Now what i want to do is i want to filter only DNS packets. I think that will be able to log the websites. I want a way to filter the DNS packets. How can I do it?

    Read the article

  • Next, Previous Records Using Named Scope

    - by keruilin
    I have a model for which I want to retrieve the next record(s) and previous record(s). I want to do this via a named_scope on the model, and also pass in as an argument the X number of next/previous records to return. For example, let's say I have 5 records: Record1 Record2 Record3 Record4 Record5 I want to be able to call Model.previous or Model.previous(1) to return Record2. Similarly, I want to be able to call Model.next or Model.next(1) to return Record4. As another example I want to be able to call Model.previous(2) to return Record3. I think you get the idea. How can I accomplish this?

    Read the article

  • What is the best way to handle validity dates in applications ?

    - by user214626
    Hello, How do we model these objects ? Scenario 1: Price changes in a time period EffectiveDate ExpiryDate Price 2009-01-01 2009-01-31 800$ 2009-02-01 Null 900$ So, if the price changes to 910$ on 2009-02-15, then the system should automatically update the expiry date on the previous effective price to 2009-02-14, to keep it consistent. Scenario 2: No price specified between 2009-02-01 to 2009-02-28 EffectiveDate ExpiryDate Price 2009-01-01 2009-01-31 800$ 2009-03-01 Null 900$ So, if new price is specified for 2009-02-15 onwards , then the system should automatically set the expiry date on the record to be inserted to 2009-02-28, because already a record effective from 2009-03-01 exists. Please suggest an effective way to handle these scenarios to model my framework, or are there any frameworks around that can do this . Thanks

    Read the article

  • How to break a Hibernate session?

    - by Péter Török
    In the Hibernate reference, it is stated several times that All exceptions thrown by Hibernate are fatal. This means you have to roll back the database transaction and close the current Session. You aren’t allowed to continue working with a Session that threw an exception. One of our legacy apps uses a single session to update/insert many records from files into a DB table. Each recourd update/insert is done in a separate transaction, which is then duly committed (or rolled back in case an error occurred). Then for the next record a new transaction is opened etc. But the same session is used throughout the whole process, even if a HibernateException was caught in the middle. We are using Oracle 9i btw with Hibernate 3.24.sp1 on JBoss 4.2. Reading the above in the book, I realized that this design may fail. So I refactored the app to use a separate session for each record update. In a unit test with a mock session factory, I could prove that it is now requesting a new session for each record update. So far, so good. However, we found no way to reproduce the session failure while testing the whole app (would this be a stress test btw, or ...?). We thought of shutting down the listener of the DB but we realized that the app is keeping a bunch of connections open to the DB, and the listener would not affect those connections. (This is a web app, activated once every night by a scheduler, but it can also be activated via the browser.) Then we tried to kill some of those connections in the DB while the app was processing updates - this resulted in some failed updates, but then the app happily continued. Apparently Hibernate is clever enough to reopen broken connections under the hood without breaking the whole session. So this might not be a critical issue, as our app seems to be robust enough even in its original form. However, the issue keeps bugging me. I would like to know: Under what circumstances does the Hibernate session really become unusable after a HibernateException was thrown? How to reproduce this in a test? (What's the proper term for such a test?)

    Read the article

  • validating creation by post_id and ip_address - Ruby on Rails

    - by bgadoci
    I have created a blog application using Ruby on Rails which includes the ability to vote on posts. A user can click vote and a record is created in the vote table. I am now trying to limit that same person from voting for a post multiple times. class Post has_many :votes end class Vote belongs_to :post end When a vote record is created I am using the VotesController to pass the :post_id and using a hidden field in the view to pass the ip_address (both to the vote table). I am wondering if there is a way to add a validation to the Vote Model that searches to see if a post_id has an ip_address that matches the person requesting to vote. I have tried simply using the validates_uniqueness_of :ip_address but that restricts the user from voting on any post. I just want to restrict the user from voting on a particular post that they have already voted on. Is there a way to do this through validation?

    Read the article

  • Check For Duplicate Records VS try/catch Unique Key Constraint

    - by Jed
    I have a database table that has a Unique Key constraint defined to avoid duplicate records from occurring. I'm curious if it is bad practice to NOT manually check for duplicate records prior to running an INSERT statement on the table. In other words, should I run a SELECT statement using a WHERE clause that checks for duplicate values of the record that I am about to INSERT. If a record is found, then do not run the INSERT statement, otherwise go ahead and run the INSERT.... OR Just run the INSERT statement and try/catch the exception that may be thrown due to a Unique Key violation. I'm weighing the two perspectives and can't decide which is best- 1. Don't waste a SELECT call to check for duplicates when I can just trap for an exception VS 2. Don't be lazy by implementing ugly try/catch logic VS 3. ???Your thoughts here??? :)

    Read the article

  • Inserting Large volume of data in SQL Server 2005

    - by Manjoor
    We have a application (written in c#) to store live stock market price in the database (SQL Server 2005). It insert about 1 Million record in a single day. Now we are adding some more segment of market into it and the no of records would be double (2 Millions/day). Currently the average record insertion per second is about 50, maximum is 450 and minimum is 0. To check certain conditions i have used service broker (asynchronous trigger) on my price table. It is running fine at this time(about 35% CPU utilization). Now i am planning to create a in memory dataset of current stock price. we would like to do some simple calculations. I want to know different views of members on this. Please provide your way of dealing with such situation.

    Read the article

  • Thinking Sphinx - sorting by a string attribute gets out of sync when changes are made

    - by Scott Brown
    I have a "restaurants" table with a "name" column. I've defined the following index: indexes "REPLACE(UPPER(restaurants.name), 'THE ', '')", :as => :restaurant_name, :sortable => true ... because I want to sort the restaurant names without respect to the prefix "The ". My problem is that whenever one of these records is updated (in any way) the new record jumps to the top of the sort order. If another record is updated, it also jumps ahead of the rest. I end up with two lists: a list of restaurants that have been updated since the last re-indexing and a list of those that haven't. Each respective list is in alphabetical order, but I don't understand why the overall list is getting segregated this way. I do have a delayed delta index set up, and I assume the issue is related to this.

    Read the article

  • Creating JTable Row Header

    - by Chandu
    Hi all, I'm new to JTable.I'm working in Swings using JTable & Toplink(JPA). I have two buttons "add Row", "Del Row" and I have some records displayed from db. when ever "add row" is clicked a new record, row header should be added to JTable with an auto increment number displayed in sequential order to the JTable Row Header. During deletion using "Del row " button the record has to be deleted & not its corresponding header so that next rows got updated to the previous headers & the auto increment number remain unchanged and always be in sequence. please help me on this regard. Thanks in advance, Chandu

    Read the article

  • Delphi, VirtualStringTree - classes (objects) instead of records

    - by michal
    I need to use a class instead of record for VirtualStringTree node. Should I declare it standard (but in this case - tricky) way like that: PNode = ^TNode; TNode = record obj: TMyObject; end; //.. var fNd: PNode; begin fNd:= vstTree.getNodeData(vstTree.AddChild(nil)); fNd.obj:= TMyObject.Create; //.. or should I use directly TMyObject? If so - how?! How about assigning (constructing) the object and freeing it? Thanks in advance m.

    Read the article

  • All embedded databases fail to open connections

    - by rsteckly
    Hi, I'm working on a winforms desktop application that needs to store data. I made the really bad decision to try and embed a database. I've tried: SQLite VistaDB SQL Server Compact In each case, I was able to generate a Entity Framework Model over the basic schema I've created. I have an event that adds data that I've been using to test these databases. Well, I kept adding a new record using EF and finding it didn't actually insert a record. In debugging, I checked the context object to see what was happening. It turns out that it is saying "the underlying provider failed to open," or something to that effect. It was not throwing an exception, just not inserting a record. The same thing has happened for all 3 embedded databases--prompting me to get it through my dense head that there has to be something wrong with my configuration. Well, I tried to write some basic sql using a sqlconnection and sqlcommand. This time it throws an exception. In the SQL Server Compact case, it now says: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) I thought perhaps a problem was the path in app.Config. So I changed the connection string to: Note that I simplified the path away from anything that might have spaces and avoided using the Data Directory nonsense that causes problem when the debugging directory does not match the preconfigured value for the data directory. I'm running Windows 7; I thought perhaps it might be an access issue--so I tried running VS 2010 in Administrator mode. No luck. I also installed Sql Server Compact SP2, thinking this might be a bug. No luck. Anyway, I'm ready to pull my hair out. I'm on a tight deadline for this thing and didn't expect to spend the day trying to figure out what is going on.

    Read the article

  • Read line comments in INI file

    - by Dave Jarvis
    The parse_ini_file function removes comments in configuration files. What would you do to keep the comments that are associated with the next line? For example: [email] ; Verify that the email's domain has a mail exchange (MX) record. validate_domain = true Am thinking of using X(HT)ML and XSLT to transform the content into an INI file (so that the documentation and options can be single sourced). For example: <h1>email</h1> <p>Verify that the email's domain has a mail exchange (MX) record.</p> <dl> <dt>validate_domain</dt> <dd>true</dd> </dl> Any other ideas?

    Read the article

  • How to use EJB 3.1 DI in Servlet ? (Could not inject session bean by @EJB from web application)

    - by kislo_metal
    I am tying to merging web application(gwt, jpa) to an separate 2 application(business login in ejb/jpa and web client in gwt). Currently i can`t inject my beans from web application (simple servlet) I am using glassfish v3. module limbo(ejb jar) is in dependency of module lust (war). If I use lust with compiler output of limbo everything work perfect (if ejb in web application and the are deploying together as one application). Have I messed some container configuration ? Here is my steps: I have some limbo.jar (ejb-jar) deployed to ejb container. I do not use any ejb-jar.xml, only annotations. package ua.co.inferno.limbo.persistence.beans; import javax.ejb.Remote; @Remote public interface IPersistentServiceRemote { ArrayList<String> getTerminalACPList(); ArrayList<String> getBoxACPList(); ArrayList<String> getCNPList(); ArrayList<String> getCNSList(); String getProductNamebyID(int boxid); ArrayList<String> getRegionsList(String lang); long getSequence(); void persistEntity (Object ent); } package ua.co.inferno.limbo.persistence.beans; import ua.co.inferno.limbo.persistence.entitis.EsetChSchemaEntity; import ua.co.inferno.limbo.persistence.entitis.EsetKeyActionsEntity; @Local public interface IPersistentService { ArrayList<String> getTerminalACPList(); ArrayList<String> getBoxACPList(); ArrayList<String> getCNPList(); ArrayList<String> getCNSList(); String getProductNamebyID(int boxid); ArrayList<String> getRegionsList(String lang); long getSequence(); long persistPurchaseBox(EsetRegPurchaserEntity rp); void removePurchaseTempBox(EsetRegPurchaserTempEntity rpt); EsetRegionsEntity getRegionsById(long rid); void persistEntity (Object ent); } package ua.co.inferno.limbo.persistence.beans; import ua.co.inferno.limbo.persistence.entitis.EsetChSchemaEntity; import ua.co.inferno.limbo.persistence.entitis.EsetKeyActionsEntity; import ua.co.inferno.limbo.persistence.entitis.EsetRegBoxesEntity; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @Stateless(name = "PersistentService") public class PersistentServiceEJB implements IPersistentService, IPersistentServiceRemote{ @PersistenceContext(unitName = "Limbo") EntityManager em; public PersistentServiceEJB() { } ......... } Than i trying to use PersistentService session bean(included in limbo.jar) from web application in lust.war (the limbo.jar & lust.war is not in ear) package ua.co.lust; import ua.co.inferno.limbo.persistence.beans.IPersistentService; import javax.ejb.EJB; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @WebServlet(name = "ServletTest", urlPatterns = {"/"}) public class ServletTest extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { service(request, response); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { service(request, response); } @EJB private IPersistentService pService; public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String hi = pService.getCNPList().toString(); System.out.println("testBean.hello method returned: " + hi); System.out.println("In MyServlet::init()"); System.out.println("all regions" + pService.getRegionsList("ua")); System.out.println("all regions" + pService.getBoxACPList()); } } web.xm <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <servlet> <servlet-name>ServletTest</servlet-name> <servlet-class>ua.co.lust.ServletTest</servlet-class> </servlet> </web-app> When servelt is loading i ge 404 eror (The requested resource () is not available.) And errors in logs : global Log Level SEVERE Logger global Name-Value Pairs {_ThreadName=Thread-1, _ThreadID=31} Record Number 1421 Message ID Complete Message Class [ Lua/co/inferno/limbo/persistence/beans/IPersistentService; ] not found. Error while loading [ class ua.co.lust.ServletTest ] javax.enterprise.system.tools.deployment.org.glassfish.deployment.common Log Level WARNING Logger javax.enterprise.system.tools.deployment.org.glassfish.deployment.common Name-Value Pairs {_ThreadName=Thread-1, _ThreadID=31} Record Number 1422 Message ID Error in annotation processing Complete Message java.lang.NoClassDefFoundError: Lua/co/inferno/limbo/persistence/beans/IPersistentService; ejb jar was deployed with this info log : Log Level INFO Logger javax.enterprise.system.container.ejb.com.sun.ejb.containers Name-Value Pairs {_ThreadName=Thread-1, _ThreadID=26} Record Number 1436 Message ID Glassfish-specific (Non-portable) JNDI names for EJB PersistentService Complete Message [ua.co.inferno.limbo.persistence.beans.IPersistentServiceRemote#ua.co.inferno.limbo.persistence.beans.IPersistentServiceRemote, ua.co.inferno.limbo.persistence.beans.IPersistentServiceRemote] Log Level INFO Logger javax.enterprise.system.tools.admin.org.glassfish.deployment.admin Name-Value Pairs {_ThreadName=Thread-1, _ThreadID=26} Record Number 1445 Message ID Complete Message limbo was successfully deployed in 610 milliseconds. Do i nee to add some additional configuration in a case of injections from others application? Some ideas?

    Read the article

  • PHP 2D Array to MySQL Database

    - by Ashley Ward
    I have a PHP 2D array, many keys, each with one value, I need to put this into a MySQL database. The database has 8 fields. Eg. Field1, Field2, Field3, etc. I am trying to ensure value1 => field1, value2 =>field2, value3 => field3 and so on, when one record is full (i.e. after 8 values) a new record should be created for the next 8 values and so on. I am aware that the 1st, 9th, 17th, 26th values etc, will need an insert statement and the intermediate values will be an update statement. What is the best way of going about this?

    Read the article

  • Resize Ext.form.ComboBox to fit its content

    - by ITRushn
    There are quite few solutions on Ext forums, but I wasn’t able to get any of them work. It seems I am missing something minor. I need to resize combobox to fit its content when it’s first created. I do not need to worry about resizing it when content is changing. Is there any working examples using Extjs 3.2? Current Code: var store = new Ext.data.ArrayStore({ fields: ['view', 'value', 'defaultselect'], data: Ext.configdata.dataCP }); comboCPU = new Ext.form.ComboBox({ tpl: '<tpl for="."><div class="x-combo-list-item"><b>{view}</b><br /></div></tpl>', store: store, displayField: 'view', width: 600, typeAhead: true, forceSelection: true, mode: 'local', triggerAction: 'all', editable: false, emptyText: 'empty text', selectOnFocus: true, listeners: { select: AdjustPrice, change: AdjustPrice, beforeselect: function (combo, record, index) { return ('false' == record.data.disabled); } }, applyTo: 'confelement' }); I've also tried removing width: 600 and replacing it with minListWidth: 600 but that result following and didnt fix the issue.

    Read the article

  • ActiveRecord model with datetime stamp with timezone support attribute.

    - by jtarchie
    Rails is great that it will support timezone overall in the application with Time.zone. I need to be able to support the timezone a user selects for a record. The user will be able to select date, time, and timezone for the record and I would like all calculations to be done with respect to the user selected timezone. My question is what is the best practice to handle user selected timezones. The model is using a time_zone_select and datetime_select for two different attributes timezone and scheduled_at. When the model saves, the scheduled_at attribute gets converted to the locally defined Time.zone. When a user goes back to edit the scheduled_at attribute with the datetime_select the datetime is set to the converted Time.zone timezone and not the timezone attribute. Is there a nice way to handle to the conversion to the user selected timezone?

    Read the article

  • Need Help on entity framework

    - by Sarathi1904
    I have 3 tables(Roles,Actions and RoleActionLinks). Roles table has few columns(RoleID,RoleName,Desc). Actions table has few colums(ActionID,ActionName,Desc). In RoleActionLink is created for store the association between Roles and Actions and this table has the columns such as RoleID,ActionID When I created the data model(edmx). it shows only Role and Action as entity. i did not find RoleActionLink table. but even there is no direct relation between Roles and Actions table, both tables are automatically related using RoleActionLink table. When i create the new Action, a action record should be populated in Action table(this is works fine). At the same time, i need to populate record in RoleActionLinks table. But i dont have the entity to populate. Please tell me how to accomplish my needs.

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >