[JBoss-dev] [ jboss-Bugs-975215 ] flushCache issue

2004-12-29 Thread SourceForge.net
Bugs item #975215, was opened at 2004-06-18 01:48
Message generated for change (Comment added) made by starksm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=376685aid=975215group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexey Loubyansky (loubyansky)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: flushCache issue

Initial Comment:
First of all, flushCache() will actually flush the cache.
It will try to passivate the cached instances. Those
instances that are in use (enlisted in transactions)
won't be passivated but still will be evicted from the
cache. Nevertheless, the instances remain associated
with the transaction and are scheduled for
synchronization at commit, i.e. they will be updated in
the database with changes made in the tx.
What is dangerous and might be a bug is that if you
find the flushed instance with the finder in the same
tx, this found instance will be put into the cache
(with the data from the db, i.e. stale data) and
associated with the tx. So, there will be two
(different) versions of the same instance and both will
be synchronized at transaction commit. Last commit wins.

You can see it with the following code:

  ALocal a =
AUtil.getLocalHome().findByPrimaryKey(new APK(new
Long(1), avoka));
  a.setName2(NAME2);

  MBeanServer server =
MBeanServerLocator.locateJBoss();
  ObjectName container = new
ObjectName(jboss.j2ee:service=EJB,jndiName=A);
  server.invoke(container, flushCache, null, null);

  a = AUtil.getLocalHome().findByPrimaryKey(new
APK(new Long(1), avoka));
  log.info(a.name2:  + a.getName2());
  a.setName2(NAME3);

http://www.jboss.org/index.html?module=bbop=viewtopicp=3839187#3839187

--

Comment By: Scott M Stark (starksm)
Date: 2004-12-29 12:52

Message:
Logged In: YES 
user_id=175228

All issues have been moved to http://jira.jboss.com. Existing
issues have been moved. New issues will be closed with this
canned reponse.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=376685aid=975215group_id=22866


---
SF email is sponsored by - The IT Product Guide
Read honest  candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development


[JBoss-dev] [ jboss-Bugs-975215 ] flushCache issue

2004-06-18 Thread SourceForge.net
Bugs item #975215, was opened at 2004-06-18 11:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=376685aid=975215group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexey Loubyansky (loubyansky)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: flushCache issue

Initial Comment:
First of all, flushCache() will actually flush the cache.
It will try to passivate the cached instances. Those
instances that are in use (enlisted in transactions)
won't be passivated but still will be evicted from the
cache. Nevertheless, the instances remain associated
with the transaction and are scheduled for
synchronization at commit, i.e. they will be updated in
the database with changes made in the tx.
What is dangerous and might be a bug is that if you
find the flushed instance with the finder in the same
tx, this found instance will be put into the cache
(with the data from the db, i.e. stale data) and
associated with the tx. So, there will be two
(different) versions of the same instance and both will
be synchronized at transaction commit. Last commit wins.

You can see it with the following code:

  ALocal a =
AUtil.getLocalHome().findByPrimaryKey(new APK(new
Long(1), avoka));
  a.setName2(NAME2);

  MBeanServer server =
MBeanServerLocator.locateJBoss();
  ObjectName container = new
ObjectName(jboss.j2ee:service=EJB,jndiName=A);
  server.invoke(container, flushCache, null, null);

  a = AUtil.getLocalHome().findByPrimaryKey(new
APK(new Long(1), avoka));
  log.info(a.name2:  + a.getName2());
  a.setName2(NAME3);

http://www.jboss.org/index.html?module=bbop=viewtopicp=3839187#3839187

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=376685aid=975215group_id=22866


---
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
___
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development