Questions tagged [detach]

279 questions
4
votes
2 answers

Entity Framework Detach an entity and the related entities gone

When I use Entity Framework, I want to query out a record in a context and add it to another context with the same schema, after query out the record, I detach it from the context, but the related entities are all away, is there any way to solve…
James
  • 2,340
  • 6
  • 30
  • 56
4
votes
0 answers

live streaming video goes black when there is no activity on the web-page

I am working on a website which has bunch of live streaming videos in it. After certain time(minutes) of inactivity in the browser, couple of live streaming videos goes black and have to refresh the page or scroll up/down in order to make it…
john
  • 9,493
  • 34
  • 111
  • 210
4
votes
1 answer

Entity framework: detaching but keeping object graph

I'm working in a disconnected scenario, but I noticed that disposing an object context does not release attached entities. As a result, subsequent operations often fail because of this. So to solve this, I detach everything myself when the object…
L-Four
  • 11,965
  • 8
  • 52
  • 103
4
votes
2 answers

clone(true) + remove() vs. detach() in jQuery

Is the usage of e = elem.clone(true); elem.remove(); Identical to e = elem.detach(); If later I append it with e.appendTo($("#someDiv")); In jQuery 1.4? Will the clone(true) method preserve everything using detach() does?
Ron Harlev
  • 15,010
  • 24
  • 83
  • 128
4
votes
0 answers

Best Practices when using JPA and detach()

I'm using the following JPA entity: @Entity @Table(name = "FOO") public class Foo { @Id @Column(name = "ID") private Integer id; @Column(name = "NAME") private String name; // getters/setters ommited for brevity } I have a…
st.never
  • 11,623
  • 4
  • 18
  • 21
4
votes
1 answer

JDODetachedFieldAccessException: You have just attempted to access field "attachment" yet this field was not detached when you detached the object

Entity class: public class CustomerSurvey implements Serializable { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CUSTOMER_SURVEY_SEQUENCE") @Column(name = "SURVEYID", nullable = false) private String…
beetri
  • 891
  • 10
  • 23
  • 37
3
votes
2 answers

How to realise detachable control in XAML & WPF

I want to have detachable controls in my software where a user can drag out a view (control) into a seperate window. Like the TabItems in Visual Studio 2010. At this time the specific views are created whenever a menu point is clicked and a new…
stmountain
  • 33
  • 3
3
votes
3 answers

Pthread create as detached

I have a problem creating a thread as detached. Here's the code I wrote: void* testFunction() { pthread_attr_t attr; int chk,rc; pthread_attr_init(&attr); printf("thread_attr_init: %d\n",rc); pthread_attr_getdetachstate(&attr,…
Manlio
  • 10,328
  • 9
  • 44
  • 76
3
votes
0 answers

Angular DOM Elements that are not destroyed

I have been building an web application on Angular and I had an issue with the performance when I create dynamic elements trough a directive. I don't know how to clear up my old elements. Here is an example what's going on…
Nestor
  • 636
  • 8
  • 24
3
votes
2 answers

Stop debugging web application on IIS in VS2010 takes long

Whenever I stop debugging an ASP.NET IIS web application it seems to take very long before VS2010 becomes responsive again (2 or 3 minutes). This happens when I close Internet Explorer 9 (which stops the debugging session), stop debugging in VS…
Koen
  • 3,505
  • 1
  • 31
  • 52
3
votes
2 answers

How to detect NFC tag was removed

I am new at NFC technology. I am trying to read and write Mifare Classic 4K tags. I succeeded reading and writing. I can detect the tag on onNewIntent action. My problem is that I could't detect when an NFC tag was removed (similar to onNewIntent…
MUMBUÇOĞLU
  • 253
  • 7
  • 23
3
votes
2 answers

thread access shared variables after main thread exit

What would happen in a multi-thread C++ program if a detached thread accesses shared variables(e.g. global variable) after the call thread exits and destruct the shared variable? class A { public: A() { printf("Constructing A\n"); } ~A() {…
hangyuan
  • 111
  • 6
3
votes
2 answers

std::thread finishes before I can detach it

If I create an std::thread that terminates before I am able to call detatch() on it, what is the expected behavior? Should an exception be thrown due to the fact that joinable is already false? If this is so, then is there a way to create a thread…
Michael Landes
  • 839
  • 1
  • 7
  • 12
3
votes
1 answer

Durandal: Manually remove view from DOM

i am creating a single page application using HotTowel SPA, which uses Durandal 2.0 I have two views, named Dashboard and Settings. When i load the website, the Dashboard view gets loaded. When i click on Settings, the Dashboard view gets…
3
votes
1 answer

Why calling DetachCurrentThread() causes excessive garbage collection?

I'm calling Java methods from C code. Every time call is made I call AttachCurrentThread and after call is made I call DetachCurrentThread. This works fine but the problem is that I see eccessive garbage collection caused by that i.e. almost every…
ivenhov
  • 211
  • 3
  • 11
1 2
3
18 19