Everyone loves unit testing. But testing persistence of entities is a bit different. You are testing a process occurring across multiple layers using different languages. Your tests have side effects (in the sense that rows are being added / modified etc).
I would like to know how you do this. For example, do your tests create a whole n...
Hi !
I'm building a workflow host that will manage WorkflowApplication instances.
Instances will use SqlWorkflowInstanceStore.
Tables and logic for SqlWorkflowInstanceStore are in the same database as my other tables and logic that I'm writing into with persistence participants.
I'm not using AppFabric.
My question is: do I need DTC...
I have a windows form with a number of data-bound fields relating to a client. Additionally, I have a DataGridView showing orders for the currently displayed client. This is achieved using the design-time Visual Studio controls (e.g. a project DataSet, BindingSources TableAdapters and a TableAdapterManager.
When loading the form to edit...
I am using Glassfish v3 server.
Usually the DB connection with EJB3 + JPA (Eclipselink) is done through injection, with @PersistenceUnit or @Persistencecontext.
However, there are 3 layers in my App :
Core (contains business logic, entities, exception handling etc)
an EJB on top of it, calling the right core objects and methods to do...
Hello,
I would like to monitor hibernate action.
I see on the internet the zentracker monitor solution that permit to monitor a lot of activity of hibernate.
But It is compatible with the last version of hibernate 3.5.*?
if it's not, do you have solution to monitor query execution time, sessionFactory opened, persitence object created...
I am storing a table using python, and I need persistance.
Essentially I am storing the table as a dictionary string to numbers. And the whole is stored with shelve
self.DB=shelve.open("%s%sMoleculeLibrary.shelve"%(directory,os.sep),writeback=True)
I use writeback to true as I found the system tend to be unstable if I don't.
So aft...
// lookup existing user & set a currently null child entity (ContactInfo)
user.setContactInfo(contactInfo);
// update the user in the datastore with newly created child Entity
entityManager.persist(user);
Generates exception:
javax.persistence.EntityExistsException: User@b3089 is already persistent
Since the user alrea...
I'm finishing my second book on iPhone development (Beginning Iphone 3 Development - Mark/LaMarche) and, while this book covers the 4 main persistence mechanisms, I'm still not sure which one to use for my application. My data model is not very intricate, but I do need some relationship definition and functionality.
So what are the sea...
Hey guys,
I just noticed that a part of code I worked on saves the same entity twice.
I tried several tricks, like flush() and Transaction REQUIRES_NEW but nothing does it.
But I can see while debugging that after calling persist(entity), I get an ID (IDENTITY) for that entity... but just a bit later in the code if I look at the variable...
Is it possible to persist a class in session that I define in VBScript in classic asp:
<script runat=server language=vbscript>
Class clsCourse
Private Sub Class_Initialize
' Statements go here.
End Sub
End Class
dim oCourse
set oCourse=new clsCourse
</script>
How would I persist oCourse in session and recover it from session?
I ...
Assume I have a class A and a class B that is derived from A. I want to pickle/unpickle an instance of class B. Both A and B define the _getstate_/_setstate_ methods (Let's assume A and B are complex, which makes the use of _getstate_ and _setstate_ necessary). How should B call the _getstate_/_setstate_ methods of A? My current, but per...
I am investigating using JPA for my Data Access code. I am trying to write the business layer and data access layer so it will work in a web application and a Java SE application. Therefore I cannot use container managed persistence context. Most of my seraches on using JPA show examples in a container managed enviroment.
At the mome...
As the title says, does anyone know of any Distributed Key/Value Stores that can run on Windows, and have .Net clients?
Thank you
Update: Sorry, forgot to add that it needs to be persisted.
...
Hi,
I'm new to JPA and now stuck with a problem!
I have two tables Person and PersonAddress.
In the Person entity, I have
@OneToMany(mappedBy="personid")
private Set<Personaddress> personaddressCollection;
and
public Set<Personaddress> getPersonaddressCollection() {
return this.personaddressCollection;
}
public void setPerson...
Hi,
I have an application deployed on Glassfish v3.0.1 which reads events from a table in my database. Once ready it marks them as processed. I am getting a strange error I can't explain when trying to call the method which does the update.
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void markEventAsPr...
Good afternoon.
Before I begin my explanation, I have had a look at other similar questions but the subtle differences (mainly in purpose of design) mean that the solutions provided in these answers to not apply to me.
I am attempting to create a 'Base data access library' for use with future projects so that I do not have to spend my ...
I have an entity that has few fields. One of them is city name. Now I want to get list of all distinct cities from that table. How can I archive that. I tried using DISTINCT keyword, but it doesn't work.
I'm using Hibernate as JPA provider but I would like to get it in pure JPA Query.
...
I have a requirement to persist a collection at design-time:
Public Class MyButton
Inherits Button
Private _MyCol As MyCol
<Editor(GetType(MyColEditor), GetType(UITypeEditor))> _
Public Property MyCol() As MyCol
Get
Return _MyCol
End Get
Set(ByVal value As MyCol)
_MyCol = ...
I am loading a series of controls in the Page_Load event. However, I have to recreate those controls each page load, which means storing their data elsewhere. This is cumbersome.
protected void Page_Load(object sender, EventArgs e)
{
MyControl control = (MyControl)LoadControl(...);
control.Initialize(GlobalClass.controlData);
...
I am writing my own custom persistence instance store for WF4, based on the XmlWorkflowInstanceStore found in the .NET 4 WF and WCF samples. This sample is quite simplistic and the xml is produces is quite verbose. I have issues with how some of the objects are serialized.
I have tried using Red Gate Reflector to understand the Sql impl...