Search Results

Search found 3635 results on 146 pages for 'concurrent collections'.

Page 12/146 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • SSIS - Limiting Concurrent Connections

    - by Bigtoe
    Hi Folks, I am using SSIS to connect to a legecy mainframe database and this allows only 5 concurrent connections at a time. I have a dataflow task with many tables to transfer and it kicks outs because of this limitation. I have split up the Data Flow task into seperate data flows and this is working for the moment, but it is not optiomal as they need to be sequenced and 1 large transfer in a flow is holding up subsequent transfers. Anyone any idea of how to limit the number of connections in a single data flow, I had a look at using the Engine Threads but this did not make any difference. Any help much appericated.

    Read the article

  • Compiling Java code in terminal having a Jar in CLASSPATH

    - by Masi
    How can you compile the code using javac in a terminal by using google-collections in CLASSPATH? Example of code trying to compile using javac in a terminal (works in Eclipse) import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; public class Locate { ... BiMap<MyFile, Integer> rankingToResult = HashBiMap.create(); ... } Compiling in terminal src 288 % javac Locate.java Locate.java:14: package com.google.common.collect does not exist import com.google.common.collect.BiMap; ^ Locate.java:15: package com.google.common.collect does not exist import com.google.common.collect.HashBiMap; ^ Locate.java:153: cannot find symbol symbol : class BiMap location: class Locate BiMap<MyFile, Integer> rankingToResult = HashBiMap.create(); ^ Locate.java:153: cannot find symbol symbol : variable HashBiMap location: class Locate BiMap<MyFile, Integer> rankingToResult = HashBiMap.create(); ^ 4 errors My CLASSPATH src 289 % echo $CLASSPATH /u/1/bin/javaLibraries/google-collect-1.0.jar

    Read the article

  • WPF: IEditableCollectionView and CanAddNew and empty collections

    - by Aran Mulholland
    We were having some issues with the wpf datagrid and IEditableCollectionView (although this question applies to using IEditableCollectionView and ItemsControl) When you have a collection with no items in it, the IEditableCollectionView cannot determine what items should be inserted so it sets CanAddNew=false we found a solution here (buried deep in the comments) that goes like so : If you derive from ObservableCollection like this public class PersonsList : ObservableCollection<Person> { } you will find out that if the initial collection is empty, there won't be a NewItemPlaceHolder showing up on the view. That's because PersonsList cannot resolve type T at design time. A workaround that works for me is to pass type T as a parameter into the class like this PersonsList<T> : ObservableCollection<T> where T : Person { } This approach will place the NewItemPlaceHolder even if the collection is empty. I'm wondering if there is an interface i can implement on my collections that inform the IEditableCollectionView which type to create should i get an AddNew request.

    Read the article

  • silverlight with WCF(get data through collections)

    - by Piyush
    in my silverlight page I am fetching the data through WCF WCF is returning an BusinessEntityCollection that is the collection of rows SqlParameter[] sqlParameter = new SqlParameter[]{new SqlParameter("@recordType",recordType)}; MenuEntity menuEntity; MenuEntityCollection menuEntityCollection = new MenuEntityCollection(); using (SqlDataReader sqlDataReader = SqlHelper.ExecuteReader(_ConnectionString,CommandType.StoredProcedure, StoredProcedures.GetMenus, sqlParameter)) { if (sqlDataReader.Read()) { menuEntity = new MenuEntity(); DataAccessHelper.GetEntity(sqlDataReader, menuEntity); menuEntityCollection.Add(menuEntity); } } return menuEntityCollection; -- in silverlight page when I am calling WCF there I am getting an error MenuEntity menuList = new MenuEntity(); menuList = e.Result; <-----error line error: Cannot implicitly convert type 'System.Collections.ObjectModel.ObservableCollection' to 'FastTrackSLUI.AdminServiceReference.MenuEntity'

    Read the article

  • How to include simple collections in ConfigurationSection

    - by mikemanne
    Is there a way for me to include a simple array of strings, or List<string> on my custom subclass of ConfigurationSection? (Or an array or generic list of simple data objects, for that matter?) I'm becoming familiar with the new (and VERY verbose) ConfigurationSection, ConfigurationElement, and ConfigurationElementCollection classes, but I'm by no means an expert yet. It seems like ConfigurationSection should handle simple collections/lists on its own, without me having to create a custom ConfigurationElementCollection subclass for each and every one. But I haven't found any reference to this ability online.

    Read the article

  • Visual Studio XSD Tool: Generate Collections Rather Than Arrays

    - by senfo
    I generated some C# classes from an XSD using the Visual Studio XSD utility and it generated arrays for storing a collection of elements, rather than one of the built-in generic Collection<T> (or related) classes. None of the command line parameters mentioned in xsd /? mention anything about generating collections rather than arrays, but I know that this can be done with web service proxy classes that Visual Studio generates, so I figured it must be possible. Does anybody know how to have the XSD utility generate collection classes rather than arrays?

    Read the article

  • Signature of Collections.min/max method

    - by Marco
    In Java, the Collections class contains the following method: public static <T extends Object & Comparable<? super T>> T min(Collection<? extends T> c) Its signature is well-known for its advanced use of generics, so much that it is mentioned in the Java in a Nutshell book and in the official Sun Generics Tutorial. However, I could not find a convincing answer to the following question: Why is the formal parameter of type Collection<? extends T>, rather than Collection<T>? What's the added benefit?

    Read the article

  • Two collections manyToOne to same primary key

    - by Ethiel
    Hi, guys, I'm coding a web page in Hibernate-JPA and Oracle. I need the following: I have two classes: Place and Home. I need two collections of type Place in every Home: I do the following: Home: @ManyToOne @JoinColumn(name="ID_PLACES") private List<Places>places1; @ManyToOne @JoinColumn(name="ID_PLACES") private List<Places>Places2; However, hibernate got an exception (repeated column) and forces to me to mapping with insert and update to false. How Can I get Two ManyToOne relationship to same primary key with insert a true?.

    Read the article

  • DTOs Collections mapping Problem

    - by the_knight5000
    I'm working now on a multi-tier project which has layers as following : DAL BLL GUI Layer and Shared DTOs between BLL and GUI layers. I'm facing a problem in mapping the Objects from DAO To DTO, No problem in the simple objects. The problem is in the Objects who have child collections of another objects. ex: Author Category --Categories --Authors the execution goes in an infinite loop of mapping and it get more complex when I want model Self-join tables ex: Safe Safe --TransferSafe(Collection<Safe>) --TransferSafe(Collection<Safe>) the execution goes in an infinite loop of mapping any suggestions about a good solution or a practical mapping pattern?

    Read the article

  • odd behavior with java collections of parameterized Class objects

    - by Paul
    Ran into some questionable behavior using lists of parameterized Class objects: ArrayList<Class<String>> classList = new ArrayList<Class<String>>(); classList.add(Integer.class); //compile error Class intClass = Integer.class; classList.add(intClass); //legal apparently, as long as intClass is not parameterized Found the same behavior for LinkedList, haven't tried other collections. Is it like this for a reason? Or have I stumbled on something?

    Read the article

  • Java Memory Model: reordering and concurrent locks

    - by Steffen Heil
    Hi The java meomry model mandates that synchronize blocks that synchronize on the same monitor enforce a before-after-realtion on the variables modified within those blocks. Example: // in thread A synchronized( lock ) { x = true; } // in thread B synchronized( lock ) { System.out.println( x ); } In this case it is garanteed that thread B will see x==true as long as thread A already passed that synchronized-block. Now I am in the process to rewrite lots of code to use the more flexible (and said to be faster) locks in java.util.concurrent, especially the ReentrantReadWriteLock. So the example looks like this: // in thread A synchronized( lock ) { lock.writeLock().lock(); x = true; lock.writeLock().unlock(); } // in thread B synchronized( lock ) { lock.readLock().lock(); System.out.println( x ); lock.readLock().unlock(); } However, I have not seen any hints within the memory model specification that such locks also imply the nessessary ordering. Looking into the implementation it seems to rely on the access to volatile variables inside AbstractQueuedSynchronizer (for the sun implementation at least). However this is not part of any specification and moreover access to non-volatile variables is not really condsidered covered by the memory barrier given by these variables, is it? So, here are my questions: Is it safe to assume the same ordering as with the "old" synchronized blocks? Is this documented somewhere? Is accessing any volatile variable a memory barrier for any other variable? Regards, Steffen

    Read the article

  • Google App Engine: Unit testing concurrent access to memcache

    - by Phuong Nguyen de ManCity fan
    Would you guys show me a way to simulating concurrent access to memcache on Google App Engine? I'm trying with LocalServiceTestHelpers and threads but don't have any luck. Every time I try to access Memcache within a thread, then I get this error: ApiProxy$CallNotFoundException: The API package 'memcache' or call 'Increment()' was not found I guess that the testing library of GAE SDK tried to mimic the real environment and thus setup the environment for only one thread (the thread that running the test) which cannot be seen by other thread. Here is a piece of code that can reproduce the problem package org.seamoo.cache.memcacheImpl; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import com.google.appengine.api.memcache.MemcacheService; import com.google.appengine.api.memcache.MemcacheServiceFactory; import com.google.appengine.tools.development.testing.LocalMemcacheServiceTestConfig; import com.google.appengine.tools.development.testing.LocalServiceTestHelper; public class MemcacheTest { LocalServiceTestHelper helper; public MemcacheTest() { LocalMemcacheServiceTestConfig memcacheConfig = new LocalMemcacheServiceTestConfig(); helper = new LocalServiceTestHelper(memcacheConfig); } /** * */ @BeforeMethod public void setUp() { helper.setUp(); } /** * @see LocalServiceTest#tearDown() */ @AfterMethod public void tearDown() { helper.tearDown(); } @Test public void memcacheConcurrentAccess() throws InterruptedException { final MemcacheService service = MemcacheServiceFactory.getMemcacheService(); Runnable runner = new Runnable() { @Override public void run() { // TODO Auto-generated method stub service.increment("test-key", 1L, 1L); try { Thread.sleep(200L); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } service.increment("test-key", 1L, 1L); } }; Thread t1 = new Thread(runner); Thread t2 = new Thread(runner); t1.start(); t2.start(); while (t1.isAlive()) { Thread.sleep(100L); } Assert.assertEquals((Long) (service.get("test-key")), new Long(4L)); } }

    Read the article

  • SQL Concurrent test update question

    - by ptoinson
    Howdy Folks, I have a SQLServer 2008 database in which I have a table for Tags. A tag is just an id and a name. The definition of the tags table looks like: CREATE TABLE [dbo].[Tag]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](255) NOT NULL CONSTRAINT [PK_Tag] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ) Name is also a unique index. further I have several processes adding data to this table at a pretty rapid rate. These processes use a stored proc that looks like: ALTER PROC [dbo].[lg_Tag_Insert] @Name varchar(255) AS DECLARE @ID int SET @ID = (select ID from Tag where Name=@Name ) if @ID is null begin INSERT Tag(Name) VALUES (@Name) RETURN SCOPE_IDENTITY() end else begin return @ID end My issues is that, other than being a novice at concurrent database design, there seems to be a race condition that is causing me to occasionally get an error that I'm trying to enter duplicate keys (Name) into the DB. The error is: Cannot insert duplicate key row in object 'dbo.Tag' with unique index 'IX_Tag_Name'. This makes sense, I'm just not sure how to fix this. If it where code I would know how to lock the right areas. SQLServer is quite a different beast. First question is what is the proper way to code this 'check, then update pattern'? It seems I need to get an exclusive lock on the row during the check, rather than a shared lock, but it's not clear to me the best way to do that. Any help in the right direction will be greatly appreciated. Thanks in advance.

    Read the article

  • How OpenStack Swift handles concurrent restful API request?

    - by Chen Xie
    I installed a swift service and was trying to know the capability of handling concurrent request. So I created massive amount of threads in Java, and sent it via the RestFUL API Not surprisingly, when the number of requests climb up, the program started to throw out exceptions. Caused by: java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:378) at sun.net.www.http.HttpClient.openServer(HttpClient.java:473) at sun.net.www.http.HttpClient.(HttpClient.java:203) But can anyone tell me how that time outhappened? I am curious of how SWIFT handles those requests. Is that by queuing the requests and because there are too many requests in the queue and wait for too long time and it's just get kicked out from the queue? If this holds, does it mean that it's an asynchronized mechanism to handle requests? Thanks.

    Read the article

  • iTextSharp error - cannot convert type 'Collections.Generic.List' to 'iTextSharp.text.Element'

    - by mike
    I am trying to export pdf file using aspx and c#. I got the following error. Cannot implicitly convert type 'System.Collections.Generic.List'' to 'iTextSharp.text.Element' I have the following code using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.html.simpleparser; StringBuilder strB = new StringBuilder(); document.Open(); if (text.Length.Equals(0))//export the text { GridView1.DataBind(); using (StringWriter sWriter = new StringWriter(strB)) { using (HtmlTextWriter htWriter = new HtmlTextWriter(sWriter)) { GridView1.RenderControl(htWriter); } } } else //export the grid { strB.Append(text); } using (TextReader sReader = new StringReader(strB.ToString())) { StyleSheet styles = new StyleSheet(); List<Element> list = new List<Element>(); list = HTMLWorker.ParseToList(sReader, styles); foreach (IElement elm in list) { document.Add(elm); } } I got the error in this line: list = HTMLWorker.ParseToList(sReader, styles); It's the first time that I am trying to export pdf files. I tried to cast the list element , however this did not solve my error. Any advice would be helpful!!!

    Read the article

  • Validation Summary for Collections

    - by Myster
    Hi All, EDIT: upgraded this question to MVC 2.0 With asp.net MVC 2.0 is there an existing method of creating Validation Summary that makes sense for models containing collections? If not I can create my own validation summary Example Model: public class GroupDetailsViewModel { public string GroupName { get; set; } public int NumberOfPeople { get; set; } public List<Person> People{ get; set; } } public class Person { [Required(ErrorMessage = "Please enter your Email Address")] [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "Please enter a valid Email Address")] public string EmailAddress { get; set; } [Required(ErrorMessage = "Please enter your Phone Number")] public string Phone { get; set; } [Required(ErrorMessage = "Please enter your First Name")] public string FirstName { get; set; } [Required(ErrorMessage = "Please enter your Last Name")] public string LastName { get; set; } } The existing summary <%=Html.ValidationSummary %> if nothing is entered looks like this. The following error(s) must be corrected before proceeding to the next step * Please enter your Email Address * Please enter your Phone Number * Please enter your First Name * Please enter your Last Name * Please enter your Email Address * Please enter your Phone Number * Please enter your First Name * Please enter your Last Name The design calls for headings to be inserted like this: The following error(s) must be corrected before proceeding to the next step Person 1 * Please enter your Email Address * Please enter your Phone Number * Please enter your First Name * Please enter your Last Name Person 2 * Please enter your Email Address * Please enter your Phone Number * Please enter your First Name * Please enter your Last Name

    Read the article

  • Essence of BiMap in Google collections

    - by littleEinstein
    I am still quite puzzled at the BiMap in Google collections/Guava. It was claimed that The two bimaps are backed by the same data; any changes to one will appear in the other. I browsed through the source code, and I found the use of delegate in ForwardingMap. But in any actually subclass of StandardBiMap, I do see the data are put into both the forward and reverse map. So what is the essence, and why it claims to have saved space by keeping only one copy of the data? Is it just the actual objects are one set, but two distinct sets of references to these objects are still needed, one set maintained in forward map, and the other in reverse map? private V putInBothMaps(K key, V value, boolean force) { boolean containedKey = containsKey(key); if (containedKey && Objects.equal(value, get(key))) { return value; } if (force) { inverse().remove(value); } else if (containsValue(value)) { throw new IllegalArgumentException( "value already present: " + value); } V oldValue = super.put(key, value); updateInverseMap(key, containedKey, oldValue, value); return oldValue; }

    Read the article

  • Date Filtered Collections without Functions

    - by madcapnmckay
    Hi, I have an entity similar to the below: public class Entity { public List<DateItem> PastDates { get; set; } public List<DateItem> FutureDates { get; set; } } public class DateItem { public DateTime Date { get; set; } /* * Other Properties * */ } Where PastDates and FutureDates are both mapped to the same type/table. I have been trying to find a way to have the Past and Future properties mapped automagically by Nhibernate. The closest I came was where clause on the mapping as follows HasMany(x => x.PastDates) .AsBag().Cascade .AllDeleteOrphan() .KeyColumnNames.Add("EventId").Where("Date < currentdate()") .Inverse(); Where currentdate is a UDF. I do not want to have these database specific functions if I can avoid it, mostly because i can't then test my DAL with SQLite as it doesn't support functions or stored procedures. At the moment I am building the past and future collections using Criteria and adding to my DTO manually. Anyone know how this could be achieved without using any UDFs? Many thanks,

    Read the article

  • ArrayList<Int> Collections.Sort and LineNumberReader Help How to

    - by user1819551
    I have a issue i can't get it to work now let going to the point a explain in the code thanks. This is my class: what I want to do is insert the Integers sort the list and buffer writer in a column with out coma. Now I getting this: [1110018, 1110032, 1110056, 1110059, 1110063, 1110085, 1110096, 1110123, 1110125, 1110185, 1110456, 1110459] I want like this: 111xxxxx 111xxxx xxxx....... I can't do it in single array, have to be in ArrayList. This is my collecting: list.addNumbers(numbers); list.display(); This is my writer: Is buffered coma.write("\n"+list.display()); coma.flush();<br/> Here is my class: public class IdCount {<br/> private ArrayList<Integer> properNumber = new ArrayList<>(); public void addNumbers(Integer numbers) { properNumber.add(numbers); Collections.sort(properNumber); } public String display() { //(I try .toString() Not work) return properNumber.toString(); } My second issue is LineNumberReader: This is my collecting and my writing: try { Reader input = new BufferedReader( new FileReader(inputFile)); try (Scanner in = new Scanner(input)) { while (in.hasNext()) { //(More Code) asp = new LineNumberReader(input); int rom = 0; while (asp.readLine()!=null){ rom++; } System.out.println(rom); coma.write(rom); This one will not write anything an my System Print give me only 12 0 in column.

    Read the article

  • Automapping Collections

    - by vaibhav
    I am using Automapper for mapping my domain model and DTO. When I map Mapper.Map<SiteDTO, SiteEntity> it works fine. But when I use collections of the same entities, it doesn't map. Mapper.Map<Collection<SiteEntity>, Collection<SiteDTO>>(siteEntityCollection); AS per Automapper Wiki, it says the lists implementing ICollection would be mapped, I am using Collection that implements ICollection, but automapper doesn't map it. Am I doing something wrong. public class SiteEntity //SiteDTO has exactly the same properties, so I am not posting it here. { public int SiteID { get; set; } public string Code { get; set; } public string Name { get; set; } public byte Status { get; set; } public int ModifiedBy { get; set; } public DateTime ModifiedDate{ get; set; } public long TimeStamp{ get; set; } public string Description{ get; set; } public string Notes{ get; set; } public ObservableCollection<AreaEntity> Areas{ get; set; } }

    Read the article

  • Synchronize write to two collections

    - by glaz666
    I need to put some value to maps if it is not there yet. The key-value (if set) should always be in two collections (that is put should happen in two maps atomically). I have tried to implement this as follows: private final ConcurrentMap<String, Object> map1 = new ConcurrentHashMap<String, Object>(); private final ConcurrentMap<String, Object> map2 = new ConcurrentHashMap<String, Object>(); public Object putIfAbsent(String key) { Object retval = map1.get(key); if (retval == null) { synchronized (map1) { retval = map1.get(key); if (retval == null) { Object value = new Object(); //or get it somewhere synchronized (map2) { map1.put(key, value); map2.put(key, new Object()); } retval = value; } } } return retval; } public void doSomething(String key) { Object obj1 = map1.get(key); Object obj2 = map2.get(key); //do smth } Will that work fine in all cases? Thanks

    Read the article

  • Is there a general concrete implementation of a KeyedCollection?

    - by CodeSavvyGeek
    The System.Collections.ObjectModel.KeyedCollection class is a very useful alternative to System.Collections.Generic.Dictionary, especially when the key data is part of the object being stored or you want to be able to enumerate the items in order. Unfortunately, the class is abstract, and I am unable to find a general concrete implementation in the core .NET framework. The Framework Design Guidlines book indicates that a concrete implementation should be provided for abstract types (section 4.4 Abstract Class Design). Why would the framework designers leave out a general concrete implementation of such a useful class, especially when it could be provided by simply exposing a constructor that accepts and stores a Converter from the item to its key: public class ConcreteKeyedCollection : KeyedCollection { private Converter getKeyForItem = null; public GenericKeyedCollection(Converter getKeyForItem) { if (getKeyForItem == null) { throw new ArgumentNullException("getKeyForItem"); } this.getKeyForItem = getKeyForItem; } protected override TKey GetKeyForItem(TItem item) { return this.getKeyForItem(item); } }

    Read the article

  • Quaere - Anyone using it yet? (LINQ to Objects for Java)

    - by Marty Pitt
    Hi there I'm a .NET guy originally, working in Java recently, and finding I'm really missing LINQ to Objects, specifically for performing filtering against collections. A few people here on Stack Overflow have answered the "LINQ for Java?" question with a single word : Quaere However, on the site it clearly states "Pre-Beta", and there's been no commits to their code for over a year, so I'm guessing the project is pretty much dead. Is anyone actually using this, and / or have any experience with it? The second most common answer appears to be "use Google Collections". Is this the most appropriate Java way? Cheers Marty

    Read the article

  • ASP.NET handling button click event before OnPreInit

    - by Phillykins
    Hello, I have a data access layer, a business logic layer and a presentation layer (ie. the pages themselves). I handle the OnPreInit event and populate collections required for the page. All the data comes from an SQL server database and I do not use caching. I handle a button click event to grab values from a form and insert a new object into the database. The problem is that by the time I handle the click event, the collections have already been populated, so the new item which has been inserted into the database has not been retrieved. What is the accepted solution to this? I could insert the new object directly into the collection and re-bind the GridView, but the SQL query selects only a set of objects and the new object could fall outside of this set. Thanks!

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >