persistence

firePropertyChange on Sequence generated Id

Hi there, When calling persist the setId method never gets called which in turns causes the firePropertyChange not to execute. I need to fire the changeSupport method because I have functionality that dependants on the state of my entity. public void setId(Long id) { Long oldId = this.id; this.id = id; changeSupport.firePro...

How do you remove rows after changing the item in a JPA OneToOne relationship?

How do you get a OneToOne item to automatically remove with JPA/Hibernate? I would expect simply setting the OneToOne item to be null in the class that contains would be smart enough to allow Hibernate to delete it. Given a simple object, simplified: @Entity public class Container { private Item item; @OneToOne(cascade=Cascad...

c# object equality for database persistance

I want to learn how others cope with the following scenario. This is not homework or an assignment of any kind. The example classes have been created to better illustrate my question however it does reflect a real life scenario which we would like feedback on. We retrieve all data from the database and place it into an object. A object...

I need to persist data on the client side (about 1M)

I need to persist my data on the client side, without it moving back and forth in each request (Kills the cookies option). I can't use special plugins/extensions. One thought I had was to generate a dynamic JS file with the needed data for the current session of the user and make sure it is cached. There is a small problem with that, as...

Why can't environmental variables set in python persist?

I was hoping to write a python script to create some appropriate environmental variables by running the script in whatever directory I'll be executing some simulation code, and I've read that I can't write a script to make these env vars persist in the mac os terminal. So two things: Is this true? and It seems like it would be a usefu...

Sqlite for disk backed associative array?

I want to use SQLite as an associative array that is saved to disk. Is this a good idea? I am worried about having to parse SQL every time I do something like: database["someindex"] which will have to be translated to something like select value from db where index = 'someindex' which in turn will have to be translated to the SQL int...

How can I have DBIC persistent database connection in mod_perl?

I am using mod_perl for my web application. Currently, I plan to use a mysql database across the network. In every CGI request to display_customer_transaction.cgi, my script will Open up database connection across network Perform query on the database using SQL statement Analysis the data retrieved from database Print out the data in H...

Java persistence in database

What is the simplest way to use database persistence in Java? I know, many frameworks exists around the Internet, but it could be fun to learn how to develop a persistence layer by myself and its design patterns. Where to start? Books, websites, how-tos, code-examples, etc. Thank you. ...

What is the fastest way to learn JPA ?

I'm looking for the best resources (books, frameworks, tutorials) that will help me get up to speed with JPA. I've been happily using iBatis/JDBC for my persistence needs, so I need resources that will hopefully provide comparable functions on how to do things. e.g. how to I set the isolation level for each transaction ? I know there m...

Best practices for using and persisting enums

I've seen several questions/discussions here about the best way to handle and persist enum-like values (e.g. http://stackoverflow.com/questions/492096/persisting-data-suited-for-enums , http://stackoverflow.com/questions/256978/how-to-persist-an-enum-using-nhibernate ), and I'd like to ask what the general consenus is. I've tried to sum...

DataNucleus: How do I automatically perform actions when commiting a transaction?

Consider having an application using DataNucleus with the following persistence structure: You have a class that has two attributes like created (Date) and lastUpdate (Date): How do you automatically fill those attributes with the appropriate values when an object of this class is going to be committed? Appropriate values would be sett...

Java, Code Generation, and Persistence Frameworks

Are there any Java code generation persistence frameworks? Something that is "database first" rather than object model first? I know this is probably heresy in the Java world, I'd just like to know if any frameworks like this exist. I'm more of a .NET guy these days. So on the .NET-side tools like .NET Tiers or CSLA come to mind. ...

Container-managed EntityManager in Servlet

How to obtain? ...

Workflow Services Persistence not working

Hi, I have created a state workflow service and set its persistance in app.config. <add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionString="Initial Catalog=WFPersistence;Data Source=LUKA-PC\SQ...

JPOX JDO and Castor JDO compared to Hibernate persistence

Do these frameworks (JPOX JDO and Cater JDO) work off similar principles as Hibernate? Do they use configuration data plus a combination of reflection and generics? What are some of the major architectural differences? ...

NHibernate Inherited Class but no need to persist

I have a class, Order, which I persist to a database using NHibernate. There is a folder futher down in the web application that contains an object that inherits from Order, for our purposes, we can call it CustomOrder. I use CustomOrder to place a few properties onto the Order object for UI purposes. The properties don't actually hav...

[Java] how to model a friends system with persistency layer?

Hi am i'm trying the new Java support for google app engine, and i am trying to make a persistency layer for all my objects. I am trying to model a friend connection but am running into problems. I use JPA to persist the objects and define my persistency objects with JPA annotations. My idea was to do the following: User Object: @E...

WF performance with new 20,000 persisted workflow instances each month

Windows Workflow Foundation has a problem that is slow when doing WF instances persistace. I'm planning to do a project whose bussiness layer will be based on WF exposed WCF services. The project will have 20,000 new workflow instances created each month, each instance could take up to 2 months to finish. What I was lead to belive that...

Need help with design structure and looking up EntityManager and UserTransaction in helper's helper

Hi there, I am basically a newbie whose starting work on a new webapp. The webapp is mostly your basic CRUD operations. For this, I have decided to use JPA with Hibernate as the Persistence provider and will be developing on Apache Derby for development and testing purposes. I am using GlassFish v2 as the App Server to deploy my EJB3 be...

nmake - how to forward macros between nmake invocations?

Hi How can I forward macros between nmake invocations? Let's say we have --- a.mak --- some_variable = value all: nmake -f b.mak --- END --- --- b.mak --- all: @echo some_variable = WHAT TO PUT HERE TO GET VALUE OF some_variable? --- END --- I was trying different things like using set and setx commands but value of vari...